PowerShell/test/csharp
Ilya 84344cbb32 Update PowerShell to build with .NET Core SDK 2.1.300-rc1-008662 (#6718)
* Build Update
- Change `TargetFramework` to `netcoreapp2.1` and removed unnecessary `RuntimeFrameworkVersion` from `PowerShell.Common.props`
- Update dotnet SDK to 2.1.300-rc1-008662
- Update `TypeGen` target in `Build.psm1` to work with 2.1
- Rename macOS runtime to `osx-x64` as the old build logic expects 10.12 and breaks running on 10.13 system.
- Remove `PackageReference` to `System.Memory` as it's part of dotnetcore 2.1
- Update search for `crossgen` executable to find the matching version

* Test Update
- Update test tools `WebListener` to latest `asp.net core`
- Marked `AuthHeader Redirect` tests as `Pending` due to change in CoreFX
2018-05-02 16:58:39 -07:00
..
csharp.tests.csproj Update PowerShell to build with .NET Core SDK 2.1.300-rc1-008662 (#6718) 2018-05-02 16:58:39 -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 Update copyright and license headers (#6134) 2018-02-13 09:23:53 -08:00
test_ExtensionMethods.cs Update copyright and license headers (#6134) 2018-02-13 09:23:53 -08:00
test_FileSystemProvider.cs Update copyright and license headers (#6134) 2018-02-13 09:23:53 -08: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.