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