From 6f91b200a08c0fb47306094bd3690947c8e269f9 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Tue, 15 Oct 2024 21:53:15 -0400 Subject: [PATCH] Use NUnit.ConsoleRunner.NetCore to run tests --- .config/dotnet-tools.json | 13 +++++++++++-- scripts/test.ps1 | 10 +--------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index c3cf16ef62..f700640e3e 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -6,13 +6,22 @@ "version": "8.8.173", "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 } } } \ No newline at end of file diff --git a/scripts/test.ps1 b/scripts/test.ps1 index eefcdb5a38..a84f67db84 100644 --- a/scripts/test.ps1 +++ b/scripts/test.ps1 @@ -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 @@ -35,4 +27,4 @@ if ($GenerateCodeCoverage -eq 'true') { Write-Output "Running the UnitTests" -& $NUnitConsoleRunner --domain:single $UnitTestsAssembly +& dotnet nunit $UnitTestsAssembly