Skip to content

Commit

Permalink
Update unit-testing-mstest-migration-from-v1-to-v3.md
Browse files Browse the repository at this point in the history
  • Loading branch information
engyebrahim authored Nov 7, 2024
1 parent 5a66197 commit 36b3b5b
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ Choose the option that best suits your project setup. Both methods ensure your p
Assert.AreEqual<customObject>(expectedObject, actualObject);
Assert.AreNotEqual<customObject>(expectedObject, actualObject);
```

- **Test Initialization**: Use `TestInitialize` methods for async initialization.
- **Cleanup**: Use `TestCleanup` methods or the `Dispose` pattern for cleanup.
- **RunSettings**: The `.testsettings` file is no longer supported, meaning `<LegacySettings>` is also no longer available. Use [.runsettings](/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file) for test configuration.
Expand Down Expand Up @@ -151,6 +152,7 @@ The DataRowAttribute constructors in MSTest v3 have been simplified to enforce t
[DataRow(1, "test")] // Correct: matches parameter types (int, string)
public void MyTestMethod(int number, string text) { ... }
```
In cases where types don’t match exactly, MSTest v3 will now raise an error rather than attempting a conversion.
### Timeout Settings
Expand Down Expand Up @@ -179,6 +181,7 @@ public void TestMethod() { ... }
[Timeout(2000)] // Verify this value still works under MSTest v3
public async Task TestMethod() { ... }
```
---
## Configuration Changes
Expand Down

0 comments on commit 36b3b5b

Please sign in to comment.