Build/Test Issues

Bug: DataTestMethod with DynamicData shows wrong result

Started by fsdMatthias on 2,988 views

The following Test shows the status "Passed" even if it should fail.


        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").


        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
Hi,

Thanks for sharing this issue. I've reproduced it as described and confirmed this is an issue in NCrunch's MSTest adapter.

Would you like to try the build below to see if this solves the problem for you?

NCrunch_Console_3.23.0.3.msi
NCrunch_Console_3.23.0.3.zip
NCrunch_GridNodeServer_3.23.0.3.msi
NCrunch_GridNodeServer_3.23.0.3.zip
NCrunch_LicenseServer_3.23.0.3.zip
NCrunch_VS2008_3.23.0.3.msi
NCrunch_VS2010_3.23.0.3.msi
NCrunch_VS2010_3.23.0.3.zip
NCrunch_VS2012_3.23.0.3.msi
NCrunch_VS2012_3.23.0.3.zip
NCrunch_VS2013_3.23.0.3.msi
NCrunch_VS2013_3.23.0.3.zip
NCrunch_VS2015_3.23.0.3.msi
NCrunch_VS2015_3.23.0.3.msi.7z
NCrunch_VS2015_3.23.0.3.zip
NCrunch_VS2017_3.23.0.3.msi
NCrunch_VS2017_3.23.0.3.msi.7z
NCrunch_VS2017_3.23.0.3.zip
I checked with the new version and it works now as expected.

Thanks

Edited

Post a reply

Log in to reply.