Skip to content

Commit e343e48

Browse files
authored
Update unit-testing-mstest-migration-from-v1-to-v3.md
1 parent 3550247 commit e343e48

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

docs/core/testing/unit-testing-mstest-migration-from-v1-to-v3.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,19 @@ Choose the option that best suits your project setup. Both methods ensure your p
139139

140140
If AreEqual, AreNotEqual, AreSame, or AreNotSame assertions cause errors, we recommend checking that the types being compared are compatible. If they are, consider adding explicit generic typing to resolve the issue.
141141

142+
### DataRowAttribute Updates
143+
144+
The DataRowAttribute constructors in MSTest v3 have been simplified to enforce type matching for parameters. This means you must specify values in DataRow that precisely match the types of the method parameters.
145+
146+
**Example**:
147+
148+
```csharp
149+
[TestMethod]
150+
[DataRow(1, "test")] // Correct: matches parameter types (int, string)
151+
public void MyTestMethod(int number, string text) { ... }
152+
```
153+
In cases where types don’t match exactly, MSTest v3 will now raise an error rather than attempting a conversion.
154+
142155
### Timeout Settings
143156
144157
In MSTest v3, the handling of `Timeout` settings has been standardized to ensure consistent behavior across different .NET environments. This change may impact tests that rely on specific timeout values, especially if those tests are asynchronous or run under different frameworks.

0 commit comments

Comments
 (0)