Rank: Newbie
Groups: Registered
Joined: 11/12/2018(UTC) Posts: 4
Thanks: 1 times Was thanked: 1 time(s) in 1 post(s)
|
The following Test shows the status "Passed" even if it should fail. Code:
public static IEnumerable<object[]> testInput => new[]
{
new object[] { new[] { 1 } },
new object[] { new[] { 1, 2 } },
};
[DataTestMethod]
[DynamicData(nameof(testInput))]
public void TestDynamicData(int[] testData)
{
CollectionAssert.AreEqual(testData, new[] { 1, 2 });
}
The problem seams to exist if the last check is valid. The following code produces the expected result ("Failed"). Code:
public static IEnumerable<object[]> testInput => new[]
{
new object[] { new[] { 1, 2 } },
new object[] { new[] { 1 } },
};
[DataTestMethod]
[DynamicData(nameof(testInput))]
public void TestDynamicData(int[] testData)
{
CollectionAssert.AreEqual(testData, new[] { 1, 2 });
}
NCrunch Version 3.22.0.1
|