mirror of
https://github.com/PowerShell/PowerShell.git
synced 2024-11-30 05:13:41 +08:00
7db6a70b56
* Update package references * Update cgmanifest * Update IsolatedModule.Tests.ps1 --------- Co-authored-by: Travis Plunk <travis.plunk@microsoft.com> |
||
---|---|---|
.. | ||
Asserts | ||
csharp | ||
AssemblyInfo.cs | ||
README.md | ||
xunit.runner.json | ||
xUnit.tests.csproj |
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
{
}