// note: only available in default appdomain
// http://weblogs.asp.net/asanto/archive/2003/09/08/26710.aspx
// Not sure we should emulate this behavior.
+#if !MONODROID
string fname = AppDomain.CurrentDomain.FriendlyName;
if (fname.EndsWith (".dll")) { // nunit-console
Assert.IsNull (Assembly.GetEntryAssembly (), "GetEntryAssembly");
Assert.IsNotNull (Assembly.GetEntryAssembly (), "GetEntryAssembly");
Assert.IsTrue (AppDomain.CurrentDomain.IsDefaultAppDomain (), "!default appdomain");
}
+#else
+ Assert.IsNull (Assembly.GetEntryAssembly (), "GetEntryAssembly");
+ Assert.IsTrue (AppDomain.CurrentDomain.IsDefaultAppDomain (), "!default appdomain");
+#endif
}
#if !MONOTOUCH // Reflection.Emit is not supported.
[Test]
+ [Category("AndroidNotWorking")] // Missing Mono.CompilerServices.SymbolWriter
public void GetModules_MissingFile ()
{
AssemblyName newName = new AssemblyName ();
public void Corlib_test ()
{
Assembly corlib_test = Assembly.GetExecutingAssembly ();
-#if MOBILE
+#if MONODROID
+ Assert.IsNull (corlib_test.EntryPoint, "EntryPoint");
+ Assert.IsNull (corlib_test.Evidence, "Evidence");
+#elif MOBILE
Assert.IsNotNull (corlib_test.EntryPoint, "EntryPoint");
Assert.IsNull (corlib_test.Evidence, "Evidence");
#else
Assert.IsTrue (corlib_test.GetReferencedAssemblies ().Length > 0, "GetReferencedAssemblies");
Assert.AreEqual (0, corlib_test.HostContext, "HostContext");
-#if NET_4_0 && !MOBILE
Assert.AreEqual ("v4.0.30319", corlib_test.ImageRuntimeVersion, "ImageRuntimeVersion");
-#else
- Assert.AreEqual ("v2.0.50727", corlib_test.ImageRuntimeVersion, "ImageRuntimeVersion");
-#endif
Assert.IsNotNull (corlib_test.ManifestModule, "ManifestModule");
Assert.IsFalse (corlib_test.ReflectionOnly, "ReflectionOnly");
}
[Test]
+ [Category ("AndroidNotWorking")] // Assemblies in Xamarin.Android cannot be accessed as FileStream
public void GetFiles_False ()
{
Assembly corlib = typeof (int).Assembly;
}
[Test]
+ [Category ("AndroidNotWorking")] // Assemblies in Xamarin.Android cannot be accessed as FileStream
public void GetFiles_True ()
{
Assembly corlib = typeof (int).Assembly;
[Test]
public void LoadWithPartialName ()
{
- string [] names = { "corlib_test_net_1_1", "corlib_test_net_2_0", "corlib_test_net_4_0", "corlib_test_net_4_5", "corlib_plattest", "mscorlibtests" };
+ string [] names = { "corlib_test_net_1_1", "corlib_test_net_2_0", "corlib_test_net_4_0", "corlib_test_net_4_5", "corlib_plattest", "mscorlibtests", "BclTests" };
foreach (string s in names)
if (Assembly.LoadWithPartialName (s) != null)
Assembly assembly = Assembly.Load (buffer);
var mm = assembly.GetType ("Program").GetMethod ("TestCall");
- mm.Invoke (null, null);
+ try {
+ mm.Invoke (null, null);
+ Assert.Fail ();
+ } catch (TargetInvocationException e) {
+ Assert.IsTrue (e.InnerException is MissingManifestResourceException);
+ }
fs.Close ();
}
}
[Test]
+ [Category("MobileNotWorking")]
public void bug78465 ()
{
string assemblyFileName = Path.Combine (
}
[Test]
+ [Category("MobileNotWorking")]
public void bug78468 ()
{
string assemblyFileNameA = Path.Combine (Path.GetTempPath (),
}
[Test]
+ [Category ("AndroidNotWorking")] // Assemblies in Xamarin.Android cannot be directly as files
public void ReflectionOnlyLoadFrom ()
{
string loc = typeof (AssemblyTest).Assembly.Location;
[Test] // bug #79715
+ [Category("MobileNotWorking")]
public void Load_PartialVersion ()
{
string tempDir = Path.Combine (Path.GetTempPath (),