User Tools

Site Tools


start

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
start [2024/08/24 01:22] – [Running with Rubix] stephenstart [2026/04/13 01:37] (current) stephen
Line 6: Line 6:
  
 This is a collection of random stuff I want to record for future reference. Probably not much use to anyone else. This is a collection of random stuff I want to record for future reference. Probably not much use to anyone else.
 +
 +====== Libyear ======
 +
 +<code powershell>
 +# .NET
 +dotnet tool install -g libyear
 +libyear
 +
 +# NPM???
 +</code>
 +
 +===== Command Line Code Coverage =====
 +
 +<code powershell>
 +### Setup
 +
 +# Install ReportGenerator globally (one-time)
 +dotnet tool install -g dotnet-reportgenerator-globaltool
 +
 +# Set up variables. Ensure your current directory is the repo root.
 +$projectName = "ApiUserCore.Tests" # or "ApiUserCore.BackgroundWorker.Tests"
 +$projectProj = "./project/$projectName/$projectName.csproj"
 +$testResults = "./project/$projectName/bin/Debug/net10.0/TestResults"
 +
 +### Generate Code Coverage
 +
 +# All tests
 +dotnet test --project $projectProj --coverage --coverage-output "coverage.cobertura.xml" --coverage-output-format cobertura
 +
 +# A specific class
 +dotnet test --project $projectProj --filter-class "*ClassName*" --coverage --coverage-output "coverage.cobertura.xml" --coverage-output-format cobertura
 +
 +### View Coverage
 +
 +# Generate an HTML report from the Cobertura XML file
 +reportgenerator -reports:"$testResults/coverage.cobertura.xml" -targetdir:"$testResults/coverage" -reporttypes:Html
 +
 +# Open the report
 +Start-Process "$testResults/coverage/index.html"
 +</code>
  
 ===== .NET Logging Levels ===== ===== .NET Logging Levels =====
start.1724462579.txt.gz · Last modified: 2024/08/24 01:22 by stephen

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki