agentsclimarketplace

Dotnet unit tests

Skill angpysha/api2skill/.agents/skills/dotnet-unit-tests

Run dotnet unit tests with Cobertura coverage and VSTest TRX output for Azure DevOps. Use at Phase 7.5 after writing tests. Produces TestResults/azure-devops-results.json.From its SKILL.md

Install
npx -y skills add angpysha/api2skill --skill dotnet-unit-tests

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

3.7 KB, 976 tokens by cl100k_base, as published. Nobody here has run it

dotnet-unit-tests

Deterministic unit test + coverage runner for .NET (xUnit). Use at step 7.5 after implementing tests and before polish / dev gate.

When to run

StepAction
7.4Write code
dotnet-formatFormat
7.5This skill — run tests + coverage
7.7Polish
7.8Dev gate

Commands

From repo root (PowerShell Core):

$Tests = '.cursor/skills/dotnet-unit-tests/scripts/dotnet-unit-tests.ps1'

# Default — Release, Cobertura + TRX
pwsh $Tests

# Filter (xUnit expression)
pwsh $Tests -Filter "FullyQualifiedName~RateLimit"

# Skip coverage (faster local loop)
pwsh $Tests -NoCoverage

Outputs (Azure DevOps)

All paths are repo-relative — stable for CI and Publish*@2 tasks.

FilePurpose
TestResults/test-results.trxVSTest results → PublishTestResults@2
TestResults/coverage/cobertura.xmlCobertura → PublishCodeCoverageResults@2
TestResults/azure-devops-results.jsonMachine-readable summary for agents / pipelines

azure-devops-results.json shape

{
  "schemaVersion": "1",
  "passed": true,
  "exitCode": 0,
  "azureDevOps": {
    "publishTestResults": {
      "testResultsFormat": "VSTest",
      "testResultsFiles": "TestResults/test-results.trx"
    },
    "publishCodeCoverageResults": {
      "codeCoverageTool": "Cobertura",
      "summaryFileLocation": "TestResults/coverage/cobertura.xml"
    }
  },
  "coverage": {
    "lineCoveragePercent": 85.2,
    "branchCoveragePercent": 72.1,
    "linesValid": 1000,
    "linesCovered": 852
  }
}

Azure Pipelines YAML

- pwsh: .cursor/skills/dotnet-unit-tests/scripts/dotnet-unit-tests.ps1
  displayName: Unit tests + coverage

- task: PublishTestResults@2
  condition: always()
  inputs:
    testResultsFormat: VSTest
    testResultsFiles: TestResults/test-results.trx
    mergeTestResults: true

- task: PublishCodeCoverageResults@2
  condition: succeededOrFailed()
  inputs:
    codeCoverageTool: Cobertura
    summaryFileLocation: $(System.DefaultWorkingDirectory)/TestResults/coverage/cobertura.xml

Manifest override (optional)

"test": {
  "command": "pwsh .cursor/skills/dotnet-unit-tests/scripts/dotnet-unit-tests.ps1",
  "filter": "Category!=Integration",
  "results": {
    "directory": "TestResults",
    "trx": "TestResults/test-results.trx",
    "cobertura": "TestResults/coverage/cobertura.xml",
    "summary": "TestResults/azure-devops-results.json"
  }
}

test.command is used by run-test-gate.ps1 when the test gate runs.

Test project requirements

  • xUnit test project(s) in the solution.
  • For coverage, test projects need coverlet.collector (or SDK-bundled collector):
<PackageReference Include="coverlet.collector" Version="6.*">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>

Checkpoint

pwsh $Tests 2>&1 | pwsh .cursor/skills/checkpoint/scripts/save-artifact.ps1 `
  -Session <session> -ArtifactRel gates/unit-tests.log -Mode --stdin

Cite TestResults/azure-devops-results.json in chat (paths + coverage %), not full Cobertura XML.

Constraints

  • Run after 7.5 test code is written — not a substitute for writing tests.
  • Integration tests (7.6) may use a separate filter; default runs the full test target.
  • On failure, loop to 7.4 / 7.5 until green.

What ships with it: 2 files

7.7 KB alongside SKILL.md, 2 of them executable

Keep looking

Skills are one crate of 326,696. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.