PowerShell/test/csharp
Dongbo Wang 54fa658e31 Migrate from project.json to MSBuild (#3398)
- FullCLR build is disabled in this change.
- FullCLR build related functionalities in `build.psm1` and `AppVeyor.psm1` are disabled. They are not cleaned up from `build.psm1` and `AppVeyor.psm1` yet. We need to adopt .NET Core 2.0 to verify the portable module concept, and if that works well, we will remove the Windows PowerShell source code and clean up our scripts.
- `dnxcore50` and `portable-net5+win8` target framework monikers are removed.
- Dependency on `Microsoft.NETCore.Portable.Compatibility` is removed. It's not necessary, but it may come back when we work on supporting the `portable module`. Its necessity can be reviewed at that time.
- I didn't spend the time to try building powershell in Visual Studio 2017. We should have a separate issue for that. It's tracked by #3400

The `TypeCatalogParser` project is replaced by a MSBuild target to gather the dependency information.
Due to .NET Core SDK issue [#1021](https://github.com/dotnet/sdk/issues/1021), our meta-package project `Microsoft.PowerShell.SDK` starts to generate an empty assembly during the build and that results in an empty assembly `Microsoft.PowerShell.SDK.dll` appear in `publish` folder and in `.deps.json` file. We cannot simply remove the assembly because it's now part of the TPA, and removing it will cause powershell to crash at startup. We have to live with this empty assembly until that .NET Core SDK issue is fixed.  It's tracked by #3401.
2017-03-23 13:04:52 -07:00
..
csharp.tests.csproj Migrate from project.json to MSBuild (#3398) 2017-03-23 13:04:52 -07:00
fixture_AssemblyLoadContext.cs Remove CoreConsoleHost from xUnit tests 2016-05-17 13:28:44 -07:00
README.md Update test documentation 2016-04-04 19:20:26 -07:00
test_Binders.cs Add all classes to AssemblyLoadContext collection 2016-03-17 18:15:39 -07:00
test_CorePsExtensions.cs Add all classes to AssemblyLoadContext collection 2016-03-17 18:15:39 -07:00
test_CorePsPlatform.cs spelling fixes: test 2016-08-25 17:49:32 +00:00
test_ExtensionMethods.cs Add all classes to AssemblyLoadContext collection 2016-03-17 18:15:39 -07:00
test_FileSystemProvider.cs Remove trailing whitespace (#3001) 2017-01-16 13:31:14 -08:00
test_MshSnapinInfo.cs Re-enable checking of assemblies with strong names 2016-06-27 14:49:46 -07:00
test_PSVersionInfo.cs Add all classes to AssemblyLoadContext collection 2016-03-17 18:15:39 -07:00
test_Runspace.cs Remove trailing whitespace (#3001) 2017-01-16 13:31:14 -08:00
test_SecuritySupport.cs Add all classes to AssemblyLoadContext collection 2016-03-17 18:15:39 -07:00
test_SessionState.cs Remove CoreConsoleHost from xUnit tests 2016-05-17 13:28:44 -07:00
test_Utils.cs Add all classes to AssemblyLoadContext collection 2016-03-17 18:15:39 -07: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.