1

Closed

DateTime NotBe()

description

public static class DateTimeAssertionsExtendedExtensions
{
    public static AndConstraint<DateTimeAssertions> NotBe(this DateTimeAssertions parent, DateTime expected)
    {
        return NotBe(parent, expected, string.Empty);
    }

    public static AndConstraint<DateTimeAssertions> NotBe(this DateTimeAssertions parent, DateTime expected, string reason, params object[] reasonArgs)
    {
        Execute.Verification
            .ForCondition(parent.Subject.Value != expected)
            .BecauseOf(reason, reasonArgs)
            .FailWith("Expected {0}{reason}, but found {1}.", expected, parent.Subject.Value);

        return new AndConstraint<DateTimeAssertions>(parent);
    }
}
Closed Aug 25, 2012 at 2:19 PM by
All done with the public beta of Fluent Assertions 2.0

comments

wrote May 30, 2012 at 6:29 PM

This has already been implemented in the latest sources so it will be in the next release.