[System] Tweak socket test
[mono-project.git] / mono / tests / loader.cs
blobcaaec151ec0089c50bbf43d36ab44901a9fc07e8
1 //
2 // loader.cs:
3 //
4 // Tests for assembly loading
5 //
7 using System;
8 using System.Reflection;
9 using System.Reflection.Emit;
11 public class Tests {
13 public static int Main (string[] args)
15 return TestDriver.RunTests (typeof (Tests), args);
18 public static int test_0_load_partial_name ()
20 if (Assembly.LoadWithPartialName ("mscorlib") == null)
21 return 1;
22 else
23 return 0;
26 public static int test_0_load_dynamic ()
28 // Check that dynamic assemblies are not loaded by Assembly.Load
29 AssemblyName an = new AssemblyName();
30 an.Name = "NOT.EXISTS";
32 AssemblyBuilder ab =
33 AppDomain.CurrentDomain.DefineDynamicAssembly(an,
34 AssemblyBuilderAccess.RunAndSave);
36 ModuleBuilder mb = ab.DefineDynamicModule("NOT.EXISTS");
38 Assembly b = Assembly.LoadWithPartialName ("NOT.EXISTS");
39 if (b == null)
40 return 0;
41 else
42 return 1;