mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-15 14:20:03 +00:00
Keep xUnit focused on pure three-scope merge and union behavior. Move the real LocalMachine write, removal, and ACL checks into the existing elevated execution-policy Pester suite, where the test runs only with MSIX package identity. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: ab738c1b-4d18-491b-a40f-0515b586857b
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
{
}