diff --git a/src/System.Runtime.Loader/tests/AssemblyLoadContextTest.cs b/src/System.Runtime.Loader/tests/AssemblyLoadContextTest.cs index 4f43e086fad8..330c0e98af25 100644 --- a/src/System.Runtime.Loader/tests/AssemblyLoadContextTest.cs +++ b/src/System.Runtime.Loader/tests/AssemblyLoadContextTest.cs @@ -145,9 +145,7 @@ public static void DefaultAssemblyLoadContext_Properties() Assert.Contains("\"Default\"", alc.ToString()); Assert.Contains("System.Runtime.Loader.DefaultAssemblyLoadContext", alc.ToString()); Assert.Contains(alc, AssemblyLoadContext.All); -#if CoreCLR_23583 Assert.Contains(Assembly.GetCallingAssembly(), alc.Assemblies); -#endif } [Fact] @@ -161,9 +159,7 @@ public static void PublicConstructor_Default() Assert.Contains("PublicConstructor", alc.ToString()); Assert.Contains("System.Runtime.Loader.AssemblyLoadContext", alc.ToString()); Assert.Contains(alc, AssemblyLoadContext.All); -#if CoreCLR_23583 Assert.Empty(alc.Assemblies); -#endif } [Theory] @@ -179,9 +175,7 @@ public static void PublicConstructor_Theory(string name, bool isCollectible) Assert.Contains(name, alc.ToString()); Assert.Contains("System.Runtime.Loader.AssemblyLoadContext", alc.ToString()); Assert.Contains(alc, AssemblyLoadContext.All); -#if CoreCLR_23583 Assert.Empty(alc.Assemblies); -#endif } } } diff --git a/src/System.Runtime.Loader/tests/DefaultContext/DefaultLoadContextTest.cs b/src/System.Runtime.Loader/tests/DefaultContext/DefaultLoadContextTest.cs index 55f4b709b8dd..13aae6f8a4f4 100644 --- a/src/System.Runtime.Loader/tests/DefaultContext/DefaultLoadContextTest.cs +++ b/src/System.Runtime.Loader/tests/DefaultContext/DefaultLoadContextTest.cs @@ -104,9 +104,7 @@ public void LoadInDefaultContext() // We should have successfully loaded the assembly in secondary load context. Assert.NotNull(slcLoadedAssembly); -#if CoreCLR_23583 Assert.Contains(slcLoadedAssembly, slc.Assemblies); -#endif // And make sure the simple name matches Assert.Equal(TestAssemblyName, slcLoadedAssembly.GetName().Name); @@ -129,9 +127,7 @@ public void LoadInDefaultContext() // We should have successfully loaded the assembly in default context. Assert.NotNull(assemblyExpectedFromLoad); -#if CoreCLR_23583 Assert.Contains(assemblyExpectedFromLoad, AssemblyLoadContext.Default.Assemblies); -#endif // We should have only invoked non-Null returning handler once Assert.Equal(1, _numNonNullResolutions); diff --git a/src/System.Runtime/tests/System/Reflection/IsCollectibleTests.cs b/src/System.Runtime/tests/System/Reflection/IsCollectibleTests.cs index 960a371d3a6b..25033169a153 100644 --- a/src/System.Runtime/tests/System/Reflection/IsCollectibleTests.cs +++ b/src/System.Runtime/tests/System/Reflection/IsCollectibleTests.cs @@ -53,9 +53,7 @@ public void Assembly_IsCollectibleFalse_WhenUsingAssemblyLoad() Assert.Contains("\"Default\"", alc.ToString()); Assert.Contains("System.Runtime.Loader.DefaultAssemblyLoadContext", alc.ToString()); Assert.Contains(alc, AssemblyLoadContext.All); -#if CoreCLR_23583 Assert.Contains(asm, alc.Assemblies); -#endif return RemoteExecutor.SuccessExitCode; }).Dispose(); @@ -78,9 +76,7 @@ public void Assembly_IsCollectibleFalse_WhenUsingAssemblyLoadContext() Assert.Contains("Assembly_IsCollectibleFalse_WhenUsingAssemblyLoadContext", alc.ToString()); Assert.Contains("System.Runtime.Loader.AssemblyLoadContext", alc.ToString()); Assert.Contains(alc, AssemblyLoadContext.All); -#if CoreCLR_23583 Assert.Contains(asm, alc.Assemblies); -#endif return RemoteExecutor.SuccessExitCode; }).Dispose(); @@ -103,9 +99,7 @@ public void Assembly_IsCollectibleTrue_WhenUsingTestAssemblyLoadContext() 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 RemoteExecutor.SuccessExitCode; }).Dispose();