Added Unit Tests

This commit is contained in:
GraceSolutions
2025-04-10 16:13:59 -04:00
parent 2a80e82288
commit 992e8b8695
15 changed files with 1109 additions and 36 deletions
+33
View File
@@ -0,0 +1,33 @@
# Run tests for SimpleWindowsNotifications
# Set the configuration
$Configuration = "Release"
# Check if dotnet CLI is available
$dotnetPath = Get-Command dotnet -ErrorAction SilentlyContinue | Select-Object -ExpandProperty Source
if (-not $dotnetPath) {
Write-Host "The .NET SDK is not installed or not in the PATH. Please install the .NET SDK." -ForegroundColor Red
exit 1
}
# Build the solution
Write-Host "Building solution..." -ForegroundColor Cyan
dotnet build SimpleWindowsNotifications.sln --configuration $Configuration
# Check if the build was successful
if ($LASTEXITCODE -ne 0) {
Write-Host "Build failed with exit code $LASTEXITCODE" -ForegroundColor Red
exit $LASTEXITCODE
}
# Run the tests
Write-Host "Running tests..." -ForegroundColor Cyan
dotnet test SimpleWindowsNotifications.sln --configuration $Configuration --no-build
# Check if the tests were successful
if ($LASTEXITCODE -eq 0) {
Write-Host "All tests passed!" -ForegroundColor Green
} else {
Write-Host "Tests failed with exit code $LASTEXITCODE" -ForegroundColor Red
exit $LASTEXITCODE
}