PowerShell/test/csharp
Steve Lee 5dc7a6cb07 Add Windows Compatibility Pack 2.0.0 to PS Core and adopt the official .NET Core 2.1 (#6958)
To support PowerShell modules built with .NET Windows Compatibility Pack, we decided that it was best to ship the WCP assemblies with PS Core. This also adds many new .NET APIs be default while only adding ~3.5 MB additional disk footprint (to a ~137 MB install currently).
Also update the build to adopt the official .NET Core 2.1.
2018-06-03 22:06:26 -07:00
..
csharp.tests.csproj Add Windows Compatibility Pack 2.0.0 to PS Core and adopt the official .NET Core 2.1 (#6958) 2018-06-03 22:06:26 -07:00
README.md Update test documentation 2016-04-04 19:20:26 -07:00
test_Binders.cs Update copyright and license headers (#6134) 2018-02-13 09:23:53 -08:00
test_CorePsPlatform.cs Cleanup NonWindowsGetDomainName() (#6948) 2018-05-31 10:18:33 +05:00
test_ExtensionMethods.cs Update copyright and license headers (#6134) 2018-02-13 09:23:53 -08:00
test_FileSystemProvider.cs Fix xUnit test GetTempFileName (#6943) 2018-05-31 11:03:14 +05:00
test_MshSnapinInfo.cs Update copyright and license headers (#6134) 2018-02-13 09:23:53 -08:00
test_PSConfiguration.cs Update copyright and license headers (#6134) 2018-02-13 09:23:53 -08:00
test_PSVersionInfo.cs Update copyright and license headers (#6134) 2018-02-13 09:23:53 -08:00
test_Runspace.cs Update copyright and license headers (#6134) 2018-02-13 09:23:53 -08:00
test_SecuritySupport.cs Update copyright and license headers (#6134) 2018-02-13 09:23:53 -08:00
test_SessionState.cs Update copyright and license headers (#6134) 2018-02-13 09:23:53 -08:00
test_Utils.cs Update copyright and license headers (#6134) 2018-02-13 09:23:53 -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.