PowerShell/test/csharp
Chunqing Chen 52df947080 Fix xunnit test for PS (#4780)
* Initial work to enable xunit

* Moved AssemblyOriginatorKeyFile to csharp.tests.csproj

* Native binary has dylib extension on macOS
2017-11-30 14:44:41 -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 Fix xunnit test for PS (#4780) 2017-11-30 14:44:41 -08:00
test_CorePsPlatform.cs Fix xunnit test for PS (#4780) 2017-11-30 14:44:41 -08:00
test_ExtensionMethods.cs Fix xunnit test for PS (#4780) 2017-11-30 14:44:41 -08:00
test_FileSystemProvider.cs Fix xunnit test for PS (#4780) 2017-11-30 14:44:41 -08:00
test_MshSnapinInfo.cs Fix xunnit test for PS (#4780) 2017-11-30 14:44:41 -08:00
test_PSVersionInfo.cs Fix xunnit test for PS (#4780) 2017-11-30 14:44:41 -08:00
test_Runspace.cs Fix xunnit test for PS (#4780) 2017-11-30 14:44:41 -08:00
test_SecuritySupport.cs Fix xunnit test for PS (#4780) 2017-11-30 14:44:41 -08:00
test_SessionState.cs Fix xunnit test for PS (#4780) 2017-11-30 14:44:41 -08:00
test_Utils.cs Fix xunnit test for PS (#4780) 2017-11-30 14:44:41 -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.