This project contains all information, code and examples to complete the unit-testing day @HxGN, 03/10/2022.
- .Net 6
- Visual Studio 2022 Professional (Paid) or Visual Studio Code
- Basic knowledge how to write C# code
- [optional] Fine Code Coverage
- Clone this repo to your local storage
- Open the solution (.Net 6) in your code editor of choice
- Restore nugets and build project
- You are ready to go.
To create coverage reports, open powershell in the "QuotesService" directory and execute the lines below.
dotnet test --collect:"XPlat Code Coverage"
$dir = ".\QuotesService.UnitTests\TestResults"
$latest = Get-ChildItem -Path $dir | Sort-Object LastAccessTime -Descending | Select-Object -First 1
Copy-Item $dir\$latest\coverage.cobertura.xml -Destination .\
dotnet $env:USERPROFILE\.nuget\packages\reportgenerator\5.0.4\tools\net6.0\ReportGenerator.dll "-reports:coverage.cobertura.xml" "-targetdir:.\report"
Start-Process .\report\index.html