Fix lookup for all SourceLink mappings, prefer local file over SourceLink
[mono-project.git] / mono / tests / assembly-loadfrom.cs
blobc4168c9fe52e8f5314663281363610c8948433cb
1 using System;
2 using System.IO;
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);
20 if (asm1 != asm2) {
21 Console.Error.WriteLine ("expected asm1 {0} and asm2 {1} to be the same", asm1, asm2);
22 return 1;
25 Type t1 = asm1.GetType ("LibClass");
26 Type t2 = asm2.GetType ("LibClass");
27 if (t1 != t2) {
28 Console.Error.WriteLine ("expected t1 {0} and t2 {1} to be the same", t1, t2);
29 return 2;
32 object o1 = Activator.CreateInstance (t1);
33 object o2 = Activator.CreateInstance (t2);
35 string s1 = o1.ToString ();
36 string s2 = o2.ToString ();
38 if (s1 != s2) {
39 Console.Error.WriteLine ("expected s1 {0} and s1 {1} to be the same", s1, s2);
40 return 3;
43 return 0;