Skip to content

Instantly share code, notes, and snippets.

@jincod
Last active January 29, 2018 17:47
Show Gist options
  • Save jincod/4f183172e46a64179a12 to your computer and use it in GitHub Desktop.
Save jincod/4f183172e46a64179a12 to your computer and use it in GitHub Desktop.
Run NUnit3 tests from powershell
$ProjectDir = "."
$PackagesDir = "$ProjectDir\packages"
$OutDir = "$ProjectDir\bin\Debug"
# Install NUnit Test Runner
$nuget = "$ProjectDir\.nuget\nuget.exe"
& $nuget install NUnit.Runners -ExcludeVersion -o $PackagesDir
# Set nunit path test runner
$nunit = "$ProjectDir\packages\NUnit.ConsoleRunner\tools\nunit3-console.exe"
#Find tests in OutDir
$tests = (Get-ChildItem $OutDir -Recurse -Include *Tests.dll)
# Run NUnit3 tests
& $nunit $tests --noheader --framework=net-4.5 --work=$OutDir
@nadvolod
Copy link

To answer my question above, this is the line of code:
& $NUnitConsoleExecutablePath $automationdll --where="cat==smoke"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment