PowerShell/test/xUnit
2019-01-30 14:12:26 -08:00
..
Asserts Fix style issues in xUnit tests (#8465) 2018-12-18 21:11:21 +05:00
csharp Change xUnit RunspaceTests to run sequentially (#8796) 2019-01-30 14:12:26 -08:00
README.md Fix broken urls (#8653) 2019-01-15 16:20:45 -08:00
xUnit.tests.csproj Build(deps): Bump XunitXml.TestLogger from 2.0.0 to 2.1.26 (#8731) 2019-01-24 11:01:24 -08:00

xUnit Tests

The folder contains xUnit tests for PowerShell Core project.

Running xUnit Tests

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

Go to the test project folder and run dotnet test -c Release.

Use filter parameter to run only needed tests:

dotnet test -c Release --filter "FullyQualifiedName~UnitTest1   # Runs tests which have UnitTest1 in FullyQualifiedName
dotnet test --filter Name~TestMethod1   # Runs tests whose name contains TestMethod1

Creating xUnit Tests

Keep the folder structure that is for Pester ../../test/powershell and C# files ../../src.

Use namespace names started with PSTests.

namespace PSTests.YourNameSpace
{
}