Skip to content

Commit

Permalink
Use NUnit.ConsoleRunner.NetCore to run tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jstedfast committed Oct 16, 2024
1 parent 41ee214 commit b0a9016
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
13 changes: 11 additions & 2 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,22 @@
"version": "8.9.3",
"commands": [
"altcover"
]
],
"rollForward": false
},
"coveralls.net": {
"version": "4.0.1",
"commands": [
"csmacnz.Coveralls"
]
],
"rollForward": false
},
"nunit.consolerunner.netcore": {
"version": "3.18.3",
"commands": [
"nunit"
],
"rollForward": false
}
}
}
10 changes: 1 addition & 9 deletions scripts/test.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,6 @@ Write-Output ""

[xml]$project = Get-Content UnitTests\UnitTests.csproj

$nugetPackagesDir = Join-Path $Home ".nuget" "packages"

# Get the NUnit.ConsoleRunner executable path
$packageReference = $project.SelectSingleNode("/Project/ItemGroup/PackageReference[@Include='NUnit.ConsoleRunner']")
$consoleRunnerVersion = $packageReference.GetAttribute("Version")

$NUnitConsoleRunner = Join-Path $nugetPackagesDir "nunit.consolerunner" $consoleRunnerVersion "tools" "nunit3-console.exe"

# Get the OutputPath
$targetFramework = $project.SelectSingleNode("/Project/PropertyGroup/TargetFramework")
$OutputDir = Join-Path "UnitTests" "bin" $Configuration $targetFramework.InnerText
Expand All @@ -35,4 +27,4 @@ if ($GenerateCodeCoverage -eq 'true') {

Write-Output "Running the UnitTests"

& $NUnitConsoleRunner --domain:single $UnitTestsAssembly
dotnet nunit $UnitTestsAssembly

0 comments on commit b0a9016

Please sign in to comment.