-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathrun-tests.ps1.example
More file actions
42 lines (36 loc) · 1.33 KB
/
run-tests.ps1.example
File metadata and controls
42 lines (36 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# Test Runner for NET-MusicAPI
# Copy this file to run-tests.ps1 and fill in your credentials
param(
[Parameter(Mandatory=$false)]
[Alias("p")]
[ValidateSet("netease", "tencent", "spotify", "")]
[string]$Platform = ""
)
# Get your Spotify credentials from: https://developer.spotify.com/dashboard
$env:SPOTIFY_CLIENT_ID = "..."
$env:SPOTIFY_CLIENT_SECRET = "..."
Write-Host "=== NET-MusicAPI Tests ===" -ForegroundColor Yellow
Write-Host "Spotify Client ID: $env:SPOTIFY_CLIENT_ID" -ForegroundColor Cyan
Write-Host "Spotify Client Secret: $env:SPOTIFY_CLIENT_SECRET" -ForegroundColor Cyan
Write-Host ""
# Determine test filter
if ($Platform -ne "") {
$testClass = switch ($Platform.ToLower()) {
"netease" { "NeteaseApiTests" }
"tencent" { "TencentApiTests" }
"spotify" { "SpotifyApiTests" }
}
Write-Host "Running tests for platform: $Platform ($testClass)" -ForegroundColor Green
Write-Host ""
# Run tests with filter
Set-Location NET-MusicAPI.Tests
dotnet test --filter "FullyQualifiedName~$testClass" --logger "console;verbosity=detailed"
Set-Location ..
} else {
Write-Host "Running all tests" -ForegroundColor Green
Write-Host ""
# Run all tests
Set-Location NET-MusicAPI.Tests
dotnet test --logger "console;verbosity=detailed"
Set-Location ..
}