Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions plugins/dotnet-test/agents/code-testing-implementer.agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ For each file in your phase:
- Note dependencies and how to mock them
- **Validate project references**: Read the test project file and verify it references the source project(s) you'll test. Add missing references before creating test files

### 3. Write Test Files
### 3. Register Test Project with Build System

If the test project is new, register it with the project's build system so the test command can discover it. See `extensions/` for language-specific instructions (e.g., `extensions/dotnet.md` for .NET solution registration).

### 4. Write Test Files

For each test file in your phase:

Expand All @@ -43,13 +47,13 @@ For each test file in your phase:
- Include tests for: happy path, edge cases (empty, null, boundary), error conditions
- Mock all external dependencies — never call external URLs, bind ports, or depend on timing

### 4. Verify with Build
### 5. Verify with Build

Call the `code-testing-builder` sub-agent to compile. Build only the specific test project, not the full solution.

If build fails: call `code-testing-fixer`, rebuild, retry up to 3 times.

### 5. Verify with Tests
### 6. Verify with Tests

Call the `code-testing-tester` sub-agent to run tests.

Expand All @@ -65,11 +69,11 @@ If tests fail:
- Never mark a test `[Ignore]`, `[Skip]`, or `[Inconclusive]`
- Retry the fix-test cycle up to 5 times

### 6. Format Code (Optional)
### 7. Format Code (Optional)

If a lint command is available, call the `code-testing-linter` sub-agent.

### 7. Report Results
### 8. Report Results

```text
PHASE: [N]
Expand Down
10 changes: 10 additions & 0 deletions plugins/dotnet-test/skills/code-testing-agent/extensions/dotnet.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,16 @@ This prevents CS0234 ("namespace not found") and CS0246 ("type not found") error
- For the final validation, build the full `.sln` with `--no-incremental`
- Full-solution builds catch cross-project reference errors invisible in scoped builds

### Registering a new test project

If a new test project was created, register it with the solution so `dotnet test` can discover it:

1. Use the exact solution or solution-filter target identified in `.testagent/research.md` or `.testagent/plan.md` — do not search for or substitute a different `.sln`, `.slnx`, or `.slnf` target.
2. If that target is a `.sln` or `.slnx`, run `dotnet sln <solution> add <test-project.csproj>`.
3. If the target is a `.slnf` (solution filter), also ensure the new project is included in the filter; adding only to the underlying `.sln` may not be enough for test discovery.
4. Skip this if the project is already included in the solution or solution filter used for testing.
5. Prefer the researched test command. If you need to run the solution directly, use `dotnet test --solution <solution>` only for repos on .NET SDK 10+ with MTP-style syntax; otherwise use the standard positional form `dotnet test <solution>`.

## MSTest Template

```csharp
Expand Down