public class ComparerTest
{
-#if !NET_4_0 // FIXME: the blob contains the 2.0 mscorlib version
+#if !NET_4_0 && !NET_2_1 // FIXME: the blob contains the 2.0 mscorlib version
[Test] // bug #80929
public void SerializeDefault ()
Assert.AreEqual (- (l.Count + 1), l.BinarySearch (int.MaxValue));
}
-#if !NET_4_0 // FIXME: the blob contains the 2.0 mscorlib version
+#if !NET_4_0 && !NET_2_1 // FIXME: the blob contains the 2.0 mscorlib version
[Test]
[Category ("TargetJvmNotWorking")]
IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForAssembly ();
Assert.AreEqual (Int64.MaxValue, isf.MaximumSize, "MaximumSize");
Assert.AreEqual (IsolatedStorageScope.User | IsolatedStorageScope.Assembly, isf.Scope, "Scope");
+#if !NET_2_1
Assert.IsTrue ((isf.AssemblyIdentity is Url), "AssemblyIdentity");
// note: mono transforms the CodeBase into uppercase
// for net 1.1 which uses file:// and not file:///
string codebase = Assembly.GetExecutingAssembly ().CodeBase.ToUpper ().Substring (8);
Assert.IsTrue ((isf.AssemblyIdentity.ToString ().ToUpper ().IndexOf (codebase) > 0), "Url");
Assert.IsTrue ((isf.AssemblyIdentity.ToString ().ToUpper ().IndexOf (codebase) > 0), "Url");
+#endif
Assert.IsTrue ((isf.CurrentSize >= 0), "CurrentSize");
}
IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForDomain ();
Assert.AreEqual (Int64.MaxValue, isf.MaximumSize, "MaximumSize");
Assert.AreEqual (IsolatedStorageScope.User | IsolatedStorageScope.Domain | IsolatedStorageScope.Assembly, isf.Scope, "Scope");
+#if !NET_2_1
Assert.IsTrue ((isf.AssemblyIdentity is Url), "AssemblyIdentity");
// note: mono transforms the CodeBase into uppercase
// for net 1.1 which uses file:// and not file:///
// so we're using the first parameter to GetCommandLineArgs
string exe = Environment.GetCommandLineArgs ()[0].Replace ("\\", "/").ToUpper ();
Assert.IsTrue ((isf.DomainIdentity.ToString ().ToUpper ().IndexOf (exe) > 0), exe + "\n" + isf.DomainIdentity.ToString ().ToUpper ()); //"Url - Domain");
+#endif
Assert.IsTrue ((isf.CurrentSize >= 0), "CurrentSize");
}
{
IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForApplication ();
Assert.AreEqual (Int64.MaxValue, isf.MaximumSize, "MaximumSize");
+#if !NET_2_1
Assert.AreEqual (IsolatedStorageScope.User | IsolatedStorageScope.Assembly, isf.Scope, "Scope");
Assert.IsTrue ((isf.AssemblyIdentity is Url), "AssemblyIdentity");
Assert.IsTrue ((isf.AssemblyIdentity.ToString ().IndexOf (Assembly.GetExecutingAssembly ().CodeBase) > 0), "Url");
+#endif
Assert.IsTrue ((isf.CurrentSize >= 0), "CurrentSize");
}
-
+
+#if !NET_2_1
[Test]
[ExpectedException (typeof (IsolatedStorageException))]
public void GetUserStoreForApplication_AssemblyIdentity ()
object o = isf.DomainIdentity;
}
#endif
+#endif
#if NET_4_0
// This is supposed to be working only in SL.
IsolatedStorageScope scope = IsolatedStorageScope.User | IsolatedStorageScope.Domain | IsolatedStorageScope.Assembly;
IsolatedStorageFile isf = IsolatedStorageFile.GetStore (scope, typeof (Zone), typeof (Zone));
Assert.AreEqual (Int64.MaxValue, isf.MaximumSize, "MaximumSize");
+#if !NET_2_1
Assert.AreEqual (IsolatedStorageScope.User | IsolatedStorageScope.Domain | IsolatedStorageScope.Assembly, isf.Scope, "Scope");
Assert.IsTrue ((isf.AssemblyIdentity is Zone), "AssemblyIdentity");
Assert.IsTrue ((isf.AssemblyIdentity.ToString ().IndexOf ("MyComputer") > 0), "Zone - Assembly");
Assert.IsTrue ((isf.DomainIdentity is Zone), "DomainIdentity");
Assert.IsTrue ((isf.DomainIdentity.ToString ().IndexOf ("MyComputer") > 0), "Zone - Domain");
+#endif
Assert.IsTrue ((isf.CurrentSize >= 0), "CurrentSize");
}
IsolatedStorageFile isf = IsolatedStorageFile.GetStore (scope, typeof (StrongName), typeof (Url));
Assert.AreEqual (Int64.MaxValue, isf.MaximumSize, "MaximumSize");
Assert.AreEqual (scope, isf.Scope, "Scope");
+#if !NET_2_1
Assert.IsTrue ((isf.AssemblyIdentity is Url), "AssemblyIdentity");
// note: mono transforms the CodeBase into uppercase
// for net 1.1 which uses file:// and not file:///
string codebase = Assembly.GetExecutingAssembly ().CodeBase.ToUpper ().Substring (8);
Assert.IsTrue ((isf.AssemblyIdentity.ToString ().ToUpper ().IndexOf (codebase) > 0), "Url");
// DomainIdentity throws a InvalidOperationException
+#endif
Assert.IsTrue ((isf.CurrentSize >= 0), "CurrentSize");
}
// Maximum size for Internet isn't (by default) Int64.MaxValue
Assert.AreEqual (scope, isf.Scope, "Scope");
+#if !NET_2_1
Assert.IsTrue ((isf.AssemblyIdentity is Zone), "AssemblyIdentity");
Assert.IsTrue ((isf.AssemblyIdentity.ToString ().IndexOf ("Intranet") > 0), "Zone - Assembly");
Assert.IsTrue ((isf.DomainIdentity is Zone), "DomainIdentity");
Assert.IsTrue ((isf.DomainIdentity.ToString ().IndexOf ("Internet") > 0), isf.DomainIdentity.ToString ()); //"Zone - Domain");
+#endif
Assert.IsTrue ((isf.CurrentSize >= 0), "CurrentSize");
}
try {
isf.CreateDirectory (path);
}
-#if NET_4_0
+#if NET_4_0 || NET_2_1
catch (IsolatedStorageException ex) {
Assert.IsFalse (ex.Message.IndexOf (path) >= 0, "Message");
Assert.IsNull (ex.InnerException, "InnerException");
}
[Test]
-#if NET_4_0
+#if NET_4_0 || NET_2_1
[ExpectedException (typeof (ArgumentException))]
#else
[ExpectedException (typeof (SecurityException))]
{
IsolatedStorageScope scope = IsolatedStorageScope.User | IsolatedStorageScope.Roaming | IsolatedStorageScope.Assembly | IsolatedStorageScope.Domain;
IsolatedStorageFile isf = IsolatedStorageFile.GetStore (scope, null, null);
+#if !NET_2_1
Assert.AreEqual (typeof (Url), isf.AssemblyIdentity.GetType (), "AssemblyIdentity");
Assert.AreEqual (typeof (Url), isf.DomainIdentity.GetType (), "DomainIdentity");
+#endif
}
[Test]
#if NET_4_0
Assert.AreEqual ("foo.type[[System.Double, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]", inst.FullName, "#3");
Assert.AreEqual ("foo.type[[System.Double, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], MonoTests.System.Reflection.Emit.MonoGenericClassTest, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", inst.AssemblyQualifiedName, "#4");
-
+#elif NET_2_1
+ Assert.AreEqual ("foo.type[[System.Double, mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.String, mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]", inst.FullName, "#3");
+ Assert.AreEqual ("foo.type[[System.Double, mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.String, mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], MonoTests.System.Reflection.Emit.MonoGenericClassTest, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", inst.AssemblyQualifiedName, "#4");
#else
-
Assert.AreEqual ("foo.type[[System.Double, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]", inst.FullName, "#3");
Assert.AreEqual ("foo.type[[System.Double, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], MonoTests.System.Reflection.Emit.MonoGenericClassTest, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", inst.AssemblyQualifiedName, "#4");
-
#endif
Assert.AreEqual ("foo.type[System.Double,System.String]", inst.ToString (), "#5");
}
}
}
-#if NET_2_0
+#if NET_2_0 && !NET_2_1
public enum ParamEnum {
None = 0,
Foo = 1,
}
[Test]
+#if NET_2_1
+ [Ignore ("There's no GAC for the NET_2_1 based profiles (Moonlight, MonoTouch and Mono for Android")]
+#endif
public void FromGlobalAccessCache ()
{
Assembly corlib = typeof (int).Assembly;
}
[Test]
+#if NET_2_1
+ [Ignore ("This constructor always throw a NotSupportedException under NET_2_1 and is useless without CryptoAPI (i.e. outside Windows)")]
+#endif
public void ConstructorIntPtr ()
{
byte[] cert = { 0x30,0x82,0x01,0xFF,0x30,0x82,0x01,0x6C,0x02,0x05,0x02,0x72,0x00,0x06,0xE8,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x02,0x05,0x00,0x30,0x5F,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x20,0x30,0x1E,0x06,0x03,0x55,0x04,0x0A,0x13,0x17,0x52,0x53,0x41,0x20,0x44,0x61,0x74,0x61,0x20,0x53,0x65,0x63,0x75,0x72,0x69,0x74,0x79,0x2C,0x20,0x49,0x6E,0x63,0x2E,0x31,0x2E,0x30,0x2C,0x06,0x03,0x55,0x04,0x0B,0x13,0x25,0x53,0x65,0x63,0x75,0x72,0x65,0x20,0x53,0x65,0x72,0x76,
// additional names (URL) used for XMLDSIG (System.Security.Cryptography.Xml)
// URL taken from http://www.w3.org/TR/2002/REC-xmldsig-core-20020212/
[Test]
+#if NET_2_1
+ [Ignore ("System.Security.dll is not part of Moonlight, MonoTouch and Mono for Android")]
+#endif
public void CreateFromURL ()
{
// URL used in SignatureMethod element
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_0
+// NET_2_1 profile lacks some (of the few) CAS features required to execute those tests
+#if NET_2_0 && !NET_2_1
using NUnit.Framework;
using System;
Assert.IsFalse (d.IsSynchronized, "IsSynchronized");
}
-#if NET_2_0 && !TARGET_JVM
+#if NET_2_0 && !TARGET_JVM && !NET_2_1
[Test] // bug #333740
public void GetEnvironmentVariables_NewlySet ()
{
Assert.IsNotNull (args [0], "application");
}
-#if NET_2_0
+#if NET_2_0 && !NET_2_1
[Test]
[ExpectedException (typeof (ArgumentException))]
public void GetEnvironmentVariable_Target_Invalid ()