Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
1 change: 1 addition & 0 deletions .cspell.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ language: en

# Project-specific technical terms and tool names
words:
- antipatterns
- Anson
- Blockquotes
- buildmark
Expand Down
2 changes: 1 addition & 1 deletion .github/agents/code-quality.agent.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: code-quality
description: Ensures code quality through comprehensive linting and static analysis.
tools: [edit, read, search, execute, github]
tools: [read, search, edit, execute, github, agent]
user-invocable: true
---

Expand Down
2 changes: 1 addition & 1 deletion .github/agents/code-review.agent.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: code-review
description: Assists in performing formal file reviews.
tools: [read, search, github, agent, execute]
tools: [read, search, edit, execute, github, web, agent]
user-invocable: true
---

Expand Down
2 changes: 1 addition & 1 deletion .github/agents/repo-consistency.agent.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: repo-consistency
description: Ensures downstream repositories remain consistent with the TemplateDotNetLibrary template patterns and best practices.
tools: [edit, read, search, github, agent]
tools: [read, search, edit, execute, github, agent]
user-invocable: true
---

Expand Down
2 changes: 1 addition & 1 deletion .github/agents/requirements.agent.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: requirements
description: Develops requirements and ensures appropriate test coverage.
tools: [edit, read, search, execute]
tools: [read, search, edit, execute, github, web, agent]
user-invocable: true
---

Expand Down
2 changes: 1 addition & 1 deletion .github/agents/software-developer.agent.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: software-developer
description: Writes production code and self-validation tests.
tools: [edit, read, search, execute, github]
tools: [read, search, edit, execute, github, agent]
user-invocable: true
---

Expand Down
2 changes: 1 addition & 1 deletion .github/agents/technical-writer.agent.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: technical-writer
description: Ensures documentation is accurate and complete.
tools: [edit, read, search, execute]
tools: [read, search, edit, execute, github, agent]
user-invocable: true
---

Expand Down
2 changes: 1 addition & 1 deletion .github/agents/test-developer.agent.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: test-developer
description: Writes unit and integration tests.
tools: [edit, read, search, execute]
tools: [read, search, edit, execute, github, agent]
user-invocable: true
---

Expand Down
87 changes: 87 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,93 @@ This repository follows continuous compliance practices from DEMA Consulting Con

For detailed requirements format, test linkage patterns, and ReqStream integration, call the @requirements agent.

## MSTest Best Practices

When writing or reviewing tests, follow these MSTest V4 best practices to avoid common antipatterns.

### Antipatterns to Avoid

#### MSTEST0058 — Assertions in Catch Blocks

Do not place assertions in catch blocks. Use `Assert.ThrowsExactly()` instead:

```csharp
// ❌ Bad: Assertion in catch block
try
{
SomeMethod();
Assert.Fail("Expected exception");
}
catch (InvalidOperationException)
{
// passes silently
}

// ✅ Good: Use Assert.ThrowsExactly
Assert.ThrowsExactly<InvalidOperationException>(() => SomeMethod());
```

#### Prefer Specific Assertions Over Assert.IsTrue/IsFalse

Using `Assert.IsTrue`/`Assert.IsFalse` for equality checks produces poor failure messages. Use specific assertions:

```csharp
// ❌ Bad: Poor failure message
Assert.IsTrue(result == 42);
Assert.IsFalse(result != 42);

// ✅ Good: Rich failure message with expected/actual values
Assert.AreEqual(42, result);
Assert.AreNotEqual(0, result);
```

#### Use Assert.HasCount for Collections

Do not use `Assert.IsTrue` for collection count checks:

```csharp
// ❌ Bad: Poor failure message
Assert.IsTrue(collection.Count == 3);

// ✅ Good: Rich failure message
Assert.HasCount(3, collection);
```

#### Use Assert.StartsWith for Prefix Checks

Do not use `Assert.IsTrue(value.StartsWith(...))` — use the dedicated assertion:

```csharp
// ❌ Bad: Poor failure message
Assert.IsTrue(value.StartsWith("prefix"));

// ✅ Good: Rich failure message showing expected prefix and actual value
Assert.StartsWith("prefix", value);
```

#### Non-Public Test Classes and Methods Are Silently Ignored

MSTest silently ignores non-public test classes and test methods — no warning or error is produced:

```csharp
// ❌ Bad: Silently ignored by the test runner
class MyTests // missing public modifier
{
[TestMethod]
void TestSomething() // missing public modifier
{ }
}

// ✅ Good: Properly visible to the test runner
[TestClass]
public class MyTests
{
[TestMethod]
public void TestSomething()
{ }
}
```

## Agent Report Files

When agents need to write report files to communicate with each other or the user, follow these guidelines:
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,8 @@ We welcome contributions! Please see our [Contributing Guide][contributing] for

This project is licensed under the MIT License - see the [LICENSE][link-license] file for details.

By contributing to this project, you agree that your contributions will be licensed under the MIT License.

## Support

- 📝 [Report a Bug](https://github.com/demaconsulting/TestResults/issues/new?labels=bug)
Expand Down
2 changes: 1 addition & 1 deletion docs/reqstream/ots-pandoctool.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
sections:
- title: OTS Software Requirements
sections:
# TODO: Add requirement when demaconsulting.pandoctool supports --validate
- title: PandocTool Requirements
# TODO: Add requirement when demaconsulting.pandoctool supports --validate
# requirements:
# - id: TestResults-OTS-PandocTool
# title: PandocTool shall convert markdown documentation to HTML for PDF generation.
Expand Down
2 changes: 1 addition & 1 deletion docs/reqstream/ots-sonarscanner.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
sections:
- title: OTS Software Requirements
sections:
# TODO: Add requirement when dotnet-sonarscanner supports --validate
- title: SonarScanner Requirements
# TODO: Add requirement when dotnet-sonarscanner supports --validate
# requirements:
# - id: TestResults-OTS-SonarScanner
# title: SonarScanner shall upload code analysis results to SonarCloud.
Expand Down
2 changes: 1 addition & 1 deletion docs/reqstream/ots-weasyprinttool.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
sections:
- title: OTS Software Requirements
sections:
# TODO: Add requirement when demaconsulting.weasyprinttool supports --validate
- title: WeasyPrintTool Requirements
# TODO: Add requirement when demaconsulting.weasyprinttool supports --validate
# requirements:
# - id: TestResults-OTS-WeasyPrintTool
# title: WeasyPrintTool shall convert HTML documentation to PDF release artifacts.
Expand Down