# PowerShell script to run MarketAlly.AIPlugin.Learning tests # Usage: .\RunTests.ps1 [test-filter] [verbosity-level] param( [string]$TestFilter = "", [string]$Verbosity = "normal", [switch]$Coverage = $false, [switch]$Logger = $false ) Write-Host "๐Ÿงช Running MarketAlly.AIPlugin.Learning Tests" -ForegroundColor Cyan Write-Host "=============================================" -ForegroundColor Cyan # Change to test project directory $TestProjectPath = Split-Path -Parent $MyInvocation.MyCommand.Path Set-Location $TestProjectPath # Build the test project first Write-Host "๐Ÿ”จ Building test project..." -ForegroundColor Yellow dotnet build --configuration Debug --verbosity quiet if ($LASTEXITCODE -ne 0) { Write-Host "โŒ Build failed. Please fix compilation errors first." -ForegroundColor Red exit 1 } Write-Host "โœ… Build successful." -ForegroundColor Green # Prepare test command $TestCommand = "dotnet test" $TestCommand += " --configuration Debug" $TestCommand += " --verbosity $Verbosity" $TestCommand += " --logger console" # Add test filter if specified if ($TestFilter) { $TestCommand += " --filter `"$TestFilter`"" Write-Host "๐Ÿ” Running tests with filter: $TestFilter" -ForegroundColor Magenta } # Add coverage collection if requested if ($Coverage) { $TestCommand += " --collect:`"XPlat Code Coverage`"" Write-Host "๐Ÿ“Š Code coverage collection enabled." -ForegroundColor Magenta } # Add additional loggers if requested if ($Logger) { $TestCommand += " --logger trx --logger html" Write-Host "๐Ÿ“ Additional loggers enabled (TRX, HTML)." -ForegroundColor Magenta } Write-Host "" Write-Host "๐Ÿš€ Executing: $TestCommand" -ForegroundColor Blue Write-Host "" # Execute the test command Invoke-Expression $TestCommand # Check test results if ($LASTEXITCODE -eq 0) { Write-Host "" Write-Host "โœ… All tests passed!" -ForegroundColor Green if ($Coverage) { Write-Host "๐Ÿ“Š Code coverage reports generated in TestResults folder." -ForegroundColor Cyan } } else { Write-Host "" Write-Host "โŒ Some tests failed. Check the output above for details." -ForegroundColor Red exit 1 } Write-Host "" Write-Host "๐Ÿ“ˆ Test Summary by Category:" -ForegroundColor Cyan Write-Host " โ€ข SecurityService Tests: Security validation and sanitization" Write-Host " โ€ข UnifiedContextService Tests: Revolutionary context integration" Write-Host " โ€ข LLMContextService Tests: Intelligent code analysis" Write-Host " โ€ข LearningOrchestrator Tests: End-to-end learning workflows" Write-Host " โ€ข Configuration Tests: Settings validation and data annotations" Write-Host " โ€ข Exception Tests: Custom exception hierarchy" Write-Host " โ€ข Plugin Tests: Main plugin interface and integration" Write-Host " โ€ข Integration Tests: Full service integration scenarios" Write-Host ""