From 1665d6c5254b0df97c75a65e8399e7185851765d Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Thu, 17 Mar 2016 19:11:41 -0700 Subject: [PATCH] Add SessionStateTests to AssemblyLoadContext collection --- test/csharp/test_SessionState.cs | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/test/csharp/test_SessionState.cs b/test/csharp/test_SessionState.cs index eac9af3db6..1963e5e28d 100644 --- a/test/csharp/test_SessionState.cs +++ b/test/csharp/test_SessionState.cs @@ -13,22 +13,21 @@ using Microsoft.PowerShell.Linux.Host; namespace PSTests { + [Collection("AssemblyLoadContext")] public class SessionStateTests { [Fact] public void TestDrives() { - PowerShellAssemblyLoadContextInitializer.SetPowerShellAssemblyLoadContext(AppContext.BaseDirectory); - CultureInfo currentCulture = CultureInfo.CurrentCulture; - PSHost hostInterface = new DefaultHost(currentCulture,currentCulture); - RunspaceConfiguration runspaceConfiguration = RunspaceConfiguration.Create(); - InitialSessionState iss = InitialSessionState.CreateDefault2(); - AutomationEngine engine = new AutomationEngine(hostInterface, runspaceConfiguration, iss); - ExecutionContext executionContext = new ExecutionContext(engine, hostInterface, iss); + CultureInfo currentCulture = CultureInfo.CurrentCulture; + PSHost hostInterface = new DefaultHost(currentCulture,currentCulture); + RunspaceConfiguration runspaceConfiguration = RunspaceConfiguration.Create(); + InitialSessionState iss = InitialSessionState.CreateDefault2(); + AutomationEngine engine = new AutomationEngine(hostInterface, runspaceConfiguration, iss); + ExecutionContext executionContext = new ExecutionContext(engine, hostInterface, iss); SessionStateInternal sessionState = new SessionStateInternal(executionContext); Collection drives = sessionState.Drives(null); - Assert.True(drives.Count>0); + Assert.True(drives.Count>0); } - } }