Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Theory with datetime randomly is not being executed (see example)
10000
#1 Posted : Monday, July 9, 2018 10:45:00 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 7/9/2018(UTC)
Posts: 2
Location: Poland

Was thanked: 3 time(s) in 1 post(s)
Hi, the following code sometimes is not being executed, whereas other 500 test are perfectly fine. There aren't any issues with ReSharper runner or with console. Newest versions of NCrunch, Visual Studio 2017 and Xunit are used

Code:

Code:
public class DateExtensionsTests
    {
        public static IEnumerable<object[]> Dates => new[]
        {
            new object[] { DateTime.MinValue, false },
            new object[] { default(DateTime), false },
            new object[] { DateTime.MaxValue, false },
            new object[] { DateTime.Now.Subtract(TimeSpan.FromDays(1)),true  }, // fails
            new object[] { DateTime.Now.Subtract(TimeSpan.FromHours(1)), false  }, // fails
            new object[] { DateTime.Now.AddDays(1), false  } // fails
        };

        [Theory, MemberData(nameof(Dates))]
        public void ShouldReturnDeadlineCorrectness(DateTime userSetDate, bool isFromPast)
        {
            userSetDate.IsFromPastExceptDefaultValue().ShouldEqual(isFromPast);
        }
    }


Error message:
Quote:
This test was not executed during a planned execution run. Ensure your test project is stable and does not contain issues in initialisation/teardown fixtures.
Remco
#2 Posted : Monday, July 9, 2018 12:34:54 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,970

Thanks: 929 times
Was thanked: 1256 time(s) in 1169 post(s)
Hi, thanks for posting!

This use case is not supported under NCrunch. See here for more details.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.024 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download