Description
When in a [DataTestMethod] that receives a string parameter, if we provide String.Empty or "" data using DataRowAttribute or DynamicDataAttribute, the received parameter is always null, not an empty string.
Steps to reproduce
Option 1
[DataRow(""), DataRow(null)]
[DataTestMethod]
public void ZoneComplementaireVide_IdEnveloppeNull(string value){
...
}
Option 2
[DataRow("", DisplayName ="Empty"), DataRow(null, DisplayName ="Null")]
[DataTestMethod]
public void ZoneComplementaireVide_IdEnveloppeNull(string value){
...
}
Option 3
private static IEnumerable<Object[]> EmptyOrNullStrings { get; } = new Object[][] {
new Object[] { string.Empty },
new Object[] { null } };
[DynamicData(nameof(EmptyOrNullStrings), DynamicDataSourceType.Property)]
[DataTestMethod]
public void ZoneComplementaireVide_IdEnveloppeNull(string value){
...
}
Expected behavior
First time the test runs: value == string.Empty
Second time the test runs: value == null
Actual behavior
Options 1 and 3: The test runs only once with value == null
Option 2: Test runs twice, both times value == null
Environment
Using Visual Studio 2019 (Version 16.4.5), the project is in .NET Framework 4.5 and the Nugets are
<package id="MSTest.TestAdapter" version="2.2.5" targetFramework="net45" />
<package id="MSTest.TestFramework" version="2.2.5" targetFramework="net45" />
Description
When in a [DataTestMethod] that receives a string parameter, if we provide String.Empty or "" data using DataRowAttribute or DynamicDataAttribute, the received parameter is always null, not an empty string.
Steps to reproduce
Option 1
Option 2
Option 3
Expected behavior
First time the test runs: value == string.Empty
Second time the test runs: value == null
Actual behavior
Options 1 and 3: The test runs only once with value == null
Option 2: Test runs twice, both times value == null
Environment
Using Visual Studio 2019 (Version 16.4.5), the project is in .NET Framework 4.5 and the Nugets are
<package id="MSTest.TestAdapter" version="2.2.5" targetFramework="net45" />
<package id="MSTest.TestFramework" version="2.2.5" targetFramework="net45" />