diff --git a/prompts/csharp-mstest.prompt.md b/prompts/csharp-mstest.prompt.md index 4d096cc..e189489 100644 --- a/prompts/csharp-mstest.prompt.md +++ b/prompts/csharp-mstest.prompt.md @@ -11,7 +11,7 @@ Your goal is to help me write effective unit tests with MSTest, covering both st ## Project Setup - Use a separate test project with naming convention `[ProjectName].Tests` -- Reference Microsoft.NET.Test.Sdk, MSTest.TestAdapter, and MSTest.TestFramework packages +- Reference MSTest package - Create test classes that match the classes being tested (e.g., `CalculatorTests` for `Calculator`) - Use .NET SDK test commands: `dotnet test` for running tests @@ -36,33 +36,32 @@ Your goal is to help me write effective unit tests with MSTest, covering both st ## Data-Driven Tests -- Use `[DataTestMethod]` combined with data source attributes +- Use `[TestMethod]` combined with data source attributes - Use `[DataRow]` for inline test data - Use `[DynamicData]` for programmatically generated test data - Use `[TestProperty]` to add metadata to tests -- Consider `[CsvDataSource]` for external data sources - Use meaningful parameter names in data-driven tests ## Assertions -* Use `Assert.AreEqual` for value equality -* Use `Assert.AreSame` for reference equality -* Use `Assert.IsTrue`/`Assert.IsFalse` for boolean conditions -* Use `CollectionAssert` for collection comparisons -* Use `StringAssert` for string-specific assertions -* Use `Assert.ThrowsException` to test exceptions -* Ensure assertions are simple in nature and have a message provided for clarity on failure +- Use `Assert.AreEqual` for value equality +- Use `Assert.AreSame` for reference equality +- Use `Assert.IsTrue`/`Assert.IsFalse` for boolean conditions +- Use `CollectionAssert` for collection comparisons +- Use `StringAssert` for string-specific assertions +- Use `Assert.Throws` to test exceptions +- Ensure assertions are simple in nature and have a message provided for clarity on failure ## Mocking and Isolation -* Consider using Moq or NSubstitute alongside MSTest -* Mock dependencies to isolate units under test -* Use interfaces to facilitate mocking -* Consider using a DI container for complex test setups +- Consider using Moq or NSubstitute alongside MSTest +- Mock dependencies to isolate units under test +- Use interfaces to facilitate mocking +- Consider using a DI container for complex test setups ## Test Organization -* Group tests by feature or component -* Use test categories with `[TestCategory("Category")]` -* Use test priorities with `[Priority(1)]` for critical tests -* Use `[Owner("DeveloperName")]` to indicate ownership +- Group tests by feature or component +- Use test categories with `[TestCategory("Category")]` +- Use test priorities with `[Priority(1)]` for critical tests +- Use `[Owner("DeveloperName")]` to indicate ownership