You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would expect this to create three single entries in the Test Explorer, but it does not (-> you can not repeat a single test, only all three):
public record CustomRecord(
decimal Number,
string Comment
);
public static IEnumerable<object[]> RecordTestData
{
get
{
yield return new object[] {
new CustomRecord(1m, "first")
};
yield return new object[] {
new CustomRecord(2m, "second")
};
yield return new object[] {
new CustomRecord(3m, "third")
};
}
}
[TestMethod]
[DynamicData(nameof(RecordTestData))]
public void TestWithRecordTestData(CustomRecord item)
{
Console.WriteLine($"item number is {item.Number} entries");
}
In this case, no "subentries" are created in the Test Explorer (you can see that as the triangle on the left side is not there):
However it works when using
public record CustomRecord
{
public decimal Number;
public string Comment = "";
}
instead of
// I call this record constructor variant
public record CustomRecord(
decimal Number,
string Comment
);
See how we suddenly have three single entries in the Test Explorer:
Steps To Reproduce
see bug description
Expected behavior
all tests shown as single entries
both record "variants" (constructor and property "variant") should yield the same output in Test Explorer
Actual behavior
all tests shown as one entry when using record constructor variant
The text was updated successfully, but these errors were encountered:
This issue is related to #1462. MSTest is currently relying on datacontract serializer as a way to discriminate entries. Because of that some data types are not "supported". We know how painful this is but we are really limited by the design of vstest in fixing this issue.
Describe the bug
I would expect this to create three single entries in the Test Explorer, but it does not (-> you can not repeat a single test, only all three):
In this case, no "subentries" are created in the Test Explorer (you can see that as the triangle on the left side is not there):
However it works when using
instead of
See how we suddenly have three single entries in the Test Explorer:
Steps To Reproduce
see bug description
Expected behavior
Actual behavior
all tests shown as one entry when using record constructor variant
The text was updated successfully, but these errors were encountered: