remove csvDataSource, fix list style
This commit is contained in:
parent
c527a9528e
commit
25f216875b
@ -40,29 +40,28 @@ Your goal is to help me write effective unit tests with MSTest, covering both st
|
|||||||
- Use `[DataRow]` for inline test data
|
- Use `[DataRow]` for inline test data
|
||||||
- Use `[DynamicData]` for programmatically generated test data
|
- Use `[DynamicData]` for programmatically generated test data
|
||||||
- Use `[TestProperty]` to add metadata to tests
|
- Use `[TestProperty]` to add metadata to tests
|
||||||
- Consider `[CsvDataSource]` for external data sources
|
|
||||||
- Use meaningful parameter names in data-driven tests
|
- Use meaningful parameter names in data-driven tests
|
||||||
|
|
||||||
## Assertions
|
## Assertions
|
||||||
|
|
||||||
* Use `Assert.AreEqual` for value equality
|
- Use `Assert.AreEqual` for value equality
|
||||||
* Use `Assert.AreSame` for reference equality
|
- Use `Assert.AreSame` for reference equality
|
||||||
* Use `Assert.IsTrue`/`Assert.IsFalse` for boolean conditions
|
- Use `Assert.IsTrue`/`Assert.IsFalse` for boolean conditions
|
||||||
* Use `CollectionAssert` for collection comparisons
|
- Use `CollectionAssert` for collection comparisons
|
||||||
* Use `StringAssert` for string-specific assertions
|
- Use `StringAssert` for string-specific assertions
|
||||||
* Use `Assert.Throws<T>` to test exceptions
|
- Use `Assert.Throws<T>` to test exceptions
|
||||||
* Ensure assertions are simple in nature and have a message provided for clarity on failure
|
- Ensure assertions are simple in nature and have a message provided for clarity on failure
|
||||||
|
|
||||||
## Mocking and Isolation
|
## Mocking and Isolation
|
||||||
|
|
||||||
* Consider using Moq or NSubstitute alongside MSTest
|
- Consider using Moq or NSubstitute alongside MSTest
|
||||||
* Mock dependencies to isolate units under test
|
- Mock dependencies to isolate units under test
|
||||||
* Use interfaces to facilitate mocking
|
- Use interfaces to facilitate mocking
|
||||||
* Consider using a DI container for complex test setups
|
- Consider using a DI container for complex test setups
|
||||||
|
|
||||||
## Test Organization
|
## Test Organization
|
||||||
|
|
||||||
* Group tests by feature or component
|
- Group tests by feature or component
|
||||||
* Use test categories with `[TestCategory("Category")]`
|
- Use test categories with `[TestCategory("Category")]`
|
||||||
* Use test priorities with `[Priority(1)]` for critical tests
|
- Use test priorities with `[Priority(1)]` for critical tests
|
||||||
* Use `[Owner("DeveloperName")]` to indicate ownership
|
- Use `[Owner("DeveloperName")]` to indicate ownership
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user