PowerShell/test/csharp
2018-01-05 16:06:36 -08:00
..
csharp.tests.csproj Fix xunnit test for PS (#4780) 2017-11-30 14:44:41 -08:00
README.md Update test documentation 2016-04-04 19:20:26 -07:00
test_Binders.cs Add xUnit tests for reading Policy settings from config file 2018-01-04 13:40:51 -08:00
test_CorePsPlatform.cs Add xUnit tests for reading Policy settings from config file 2018-01-04 13:40:51 -08:00
test_ExtensionMethods.cs Add xUnit tests for reading Policy settings from config file 2018-01-04 13:40:51 -08:00
test_FileSystemProvider.cs Add xUnit tests for reading Policy settings from config file 2018-01-04 13:40:51 -08:00
test_MshSnapinInfo.cs Add xUnit tests for reading Policy settings from config file 2018-01-04 13:40:51 -08:00
test_PSConfiguration.cs Rename 'PowerShellProperties.json' to 'powershell.config.json' 2018-01-05 16:06:36 -08:00
test_PSVersionInfo.cs Add xUnit tests for reading Policy settings from config file 2018-01-04 13:40:51 -08:00
test_Runspace.cs Add xUnit tests for reading Policy settings from config file 2018-01-04 13:40:51 -08:00
test_SecuritySupport.cs Add xUnit tests for reading Policy settings from config file 2018-01-04 13:40:51 -08:00
test_SessionState.cs Add xUnit tests for reading Policy settings from config file 2018-01-04 13:40:51 -08:00
test_Utils.cs Add xUnit tests for reading Policy settings from config file 2018-01-04 13:40:51 -08:00

xUnit Tests

These tests are completely Linux specific.

Every test class must belong to [Collection("AssemblyLoadContext")]. This ensures that PowerShell's AssemblyLoadContext is initialized before any other code is executed. When this is not the case, late initialization fails with System.InvalidOperationException : Binding model is already locked for the AppDomain and cannot be reset.

Having every class in the same collection is as close to an xUnit global init hook as can be done.

Running xUnit Tests

Go to the top level of the PowerShell repository and run: Start-PSxUnit inside a self-hosted copy of PowerShell.