3 using System
.Reflection
;
5 public class TestAssemblyLoad
{
7 public static int Main ()
9 return TestDriver
.RunTests (typeof (TestAssemblyLoad
));
12 public static int test_0_LoadFromSameAssemblyName ()
15 string path1
= Path
.Combine (AppDomain
.CurrentDomain
.BaseDirectory
, "assembly-load-dir1", "Lib.dll");
16 string path2
= Path
.Combine (AppDomain
.CurrentDomain
.BaseDirectory
, "assembly-load-dir2", "Lib.dll");
18 Assembly asm1
= Assembly
.LoadFrom (path1
);
19 Assembly asm2
= Assembly
.LoadFrom (path2
);
21 Console
.Error
.WriteLine ("expected asm1 {0} and asm2 {1} to be the same", asm1
, asm2
);
25 Type t1
= asm1
.GetType ("LibClass");
26 Type t2
= asm2
.GetType ("LibClass");
28 Console
.Error
.WriteLine ("expected t1 {0} and t2 {1} to be the same", t1
, t2
);
32 object o1
= Activator
.CreateInstance (t1
);
33 object o2
= Activator
.CreateInstance (t2
);
35 string s1
= o1
.ToString ();
36 string s2
= o2
.ToString ();
39 Console
.Error
.WriteLine ("expected s1 {0} and s1 {1} to be the same", s1
, s2
);