public void Should_fail_with_descriptive_message_when_asserting_datetime_is_on_or_after_later_datetime() { DateTimeOffsetAssertions assertions = Today.Should(); assertions.Invoking(x => x.BeOnOrAfter(Tomorrow, "because we want to test the failure {0}", "message")) .ShouldThrow <AssertFailedException>() .WithMessage(string.Format( "Expected a date and time on or after <{0}> because we want to test the failure message, but found <{1}>.", Tomorrow.ToString("yyyy-MM-dd"), Today.ToString("yyyy-MM-dd"))); }
public void Should_fail_with_descriptive_message_when_asserting_datetime_is_before_earlier_datetime() { DateTimeOffsetAssertions assertions = Today.Should(); assertions.Invoking(x => x.BeBefore(Yesterday, "because we want to test the failure {0}", "message")) .ShouldThrow <AssertFailedException>() .WithMessage(string.Format( "Expected a date and time before <{0}> because we want to test the failure message, but found <{1}>.", Yesterday.ToString("yyyy-MM-dd"), Today.ToString("yyyy-MM-dd"))); }
public void Should_fail_when_asserting_datetime_is_on_or_after_later_datetime() { Action act = () => Today.Should().BeOnOrAfter(Tomorrow); act.ShouldThrow <AssertFailedException>(); }
public void Should_succeed_when_asserting_datetime_is_on_or_after_the_same_datetime() { Today.Should().BeOnOrAfter(Today); }
public void Should_succeed_when_asserting_datetime_is_on_or_after_earlier_datetime() { Today.Should().BeOnOrAfter(Yesterday); }
public void Should_fail_when_asserting_datetime_is_on_or_before_earlier_datetime() { Action act = () => Today.Should().BeOnOrBefore(Yesterday); act.ShouldThrow <AssertFailedException>(); }
public void Should_succeed_when_asserting_datetime_is_on_or_before_the_same_datetime() { Today.Should().BeOnOrBefore(Today); }
public void Should_succeed_when_asserting_datetime_is_on_or_before_later_datetime() { Today.Should().BeOnOrBefore(Tomorrow); }