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