public void Assembly_IsCollectibleTrue_WhenUsingAssemblyLoadContext() { RemoteInvoke(() => { AssemblyLoadContext alc = new TestAssemblyLoadContext(); Assembly asm = alc.LoadFromAssemblyPath(asmPath); Assert.NotNull(asm); Assert.True(asm.IsCollectible); return(SuccessExitCode); }).Dispose(); }
public void GenericWithCollectibleTypeParameter_IsCollectibleTrue_WhenUsingAssemblyLoadContext() { RemoteExecutor.Invoke(() => { AssemblyLoadContext alc = new TestAssemblyLoadContext(); Type t1 = Type.GetType( "System.Collections.Generic.Dictionary`2[[System.Int32],[TestCollectibleAssembly.MyTestClass, TestCollectibleAssembly, Version=1.0.0.0]]", collectibleAssemblyResolver(alc), typeResolver(false), true ); Assert.NotNull(t1); Assert.True(t1.IsCollectible); }).Dispose(); }
public void Assembly_IsCollectibleTrue_WhenUsingTestAssemblyLoadContext() { RemoteExecutor.Invoke(() => { AssemblyLoadContext alc = new TestAssemblyLoadContext(); Assembly asm = alc.LoadFromAssemblyPath(asmPath); Assert.NotNull(asm); Assert.True(asm.IsCollectible); Assert.True(alc.IsCollectible); Assert.Null(alc.Name); Assert.Contains("\"\"", alc.ToString()); Assert.Contains("System.Reflection.Tests.TestAssemblyLoadContext", alc.ToString()); Assert.Contains(alc, AssemblyLoadContext.All); Assert.Contains(asm, alc.Assemblies); }).Dispose(); }
public void MemberInfoGeneric_IsCollectibleTrue_WhenUsingAssemblyLoadContext(string memberName) { RemoteExecutor.Invoke((marshalledName) => { AssemblyLoadContext alc = new TestAssemblyLoadContext(); Type t1 = Type.GetType( "TestCollectibleAssembly.MyGenericTestClass`1[System.Int32], TestCollectibleAssembly, Version=1.0.0.0", collectibleAssemblyResolver(alc), typeResolver(false), true ); Assert.NotNull(t1); var member = t1.GetMember(marshalledName).FirstOrDefault(); Assert.NotNull(member); Assert.True(member.IsCollectible); }, memberName).Dispose(); }
public void Assembly_IsCollectibleTrue_WhenUsingTestAssemblyLoadContext() { RemoteInvoke(() => { AssemblyLoadContext alc = new TestAssemblyLoadContext(); Assembly asm = alc.LoadFromAssemblyPath(asmPath); Assert.NotNull(asm); Assert.True(asm.IsCollectible); Assert.True(alc.IsCollectible); Assert.Null(alc.Name); Assert.Contains("\"\"", alc.ToString()); Assert.Contains("System.Reflection.Tests.TestAssemblyLoadContext", alc.ToString()); Assert.Contains(alc, AssemblyLoadContext.All); #if CoreCLR_23583 Assert.Contains(asm, alc.Assemblies); #endif return(SuccessExitCode); }).Dispose(); }
public void MemberInfo_IsCollectibleTrue_WhenUsingAssemblyLoadContext(string memberName) { RemoteInvoke((marshalledName) => { AssemblyLoadContext alc = new TestAssemblyLoadContext(); Type t1 = Type.GetType( "TestCollectibleAssembly.MyTestClass, TestCollectibleAssembly, Version=1.0.0.0", collectibleAssemblyResolver(alc), typeResolver(false), true ); Assert.NotNull(t1); var member = t1.GetMember(marshalledName).FirstOrDefault(); Assert.NotNull(member); Assert.True(member.IsCollectible); return(SuccessExitCode); }, memberName).Dispose(); }