Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: ee0bc0d176
Fetching contributors…

Cannot retrieve contributors at this time

47 lines (36 sloc) 0.948 kb
//
// loader.cs:
//
// Tests for assembly loading
//
using System;
using System.Reflection;
using System.Reflection.Emit;
public class Tests {
public static int Main (string[] args)
{
return TestDriver.RunTests (typeof (Tests), args);
}
public static int test_0_load_partial_name ()
{
if (Assembly.LoadWithPartialName ("mscorlib") == null)
return 1;
else
return 0;
}
public static int test_0_load_dynamic ()
{
// Check that dynamic assemblies are not loaded by Assembly.Load
AssemblyName an = new AssemblyName();
an.Name = "NOT.EXISTS";
AssemblyBuilder ab =
AppDomain.CurrentDomain.DefineDynamicAssembly(an,
AssemblyBuilderAccess.RunAndSave);
ModuleBuilder mb = ab.DefineDynamicModule("NOT.EXISTS");
Assembly b = Assembly.LoadWithPartialName ("NOT.EXISTS");
if (b == null)
return 0;
else
return 1;
}
}
Jump to Line
Something went wrong with that request. Please try again.