Пример #1
0
        public void NotIsFalseMayThrowExceptions()
        {
            const bool tddSucks = false;

            EntityNamingLogic.ClearDefaultNameCache();
            Check.ThatCode(() => Check.That(tddSucks).Not.IsFalse())
            .IsAFailingCheckWithMessage(Environment.NewLine + "The checked boolean is false whereas it must be true." + Environment.NewLine + "The checked boolean:" + Environment.NewLine + "\t[False]");
        }
Пример #2
0
 public void ShouldFailWithHashesWhenSimilar()
 {
     EntityNamingLogic.ClearDefaultNameCache();
     Check.ThatCode(() => { Check.That(new Basic(1, 2)).IsEqualTo(new Basic(1, 3)); })
     .IsAFailingCheckWithMessage("",
                                 "The checked struct is different from the expected one.",
                                 "The checked struct:",
                                 "\t[NFluent.Tests.EnumOrStructRelatedTests+Basic] with HashCode: [3]",
                                 "The expected struct:",
                                 "\t[NFluent.Tests.EnumOrStructRelatedTests+Basic] with HashCode: [4]");
 }
Пример #3
0
 public void NotIsInstanceOfThrows()
 {
     EntityNamingLogic.ClearDefaultNameCache();
     Check.ThatCode(() => Check.That(FirstLetterLowerCase).Not.IsInstanceOf <char>())
     .IsAFailingCheckWithMessage("",
                                 "The checked char is an instance of [char] whereas it must not.",
                                 "The checked char:",
                                 "\t['a'] of type: [char]",
                                 "The expected value: different from",
                                 "\tan instance of [char]");
 }
Пример #4
0
        public void NotIsBeforeMayThrowException()
        {
            var christmas2013   = new DateTime(2013, 12, 25);
            var newYearsEve2014 = new DateTime(2013, 12, 31);

            EntityNamingLogic.ClearDefaultNameCache();
            Check.ThatCode(() =>
            {
                Check.That(christmas2013).Not.IsBefore(newYearsEve2014);
            })
            .IsAFailingCheckWithMessage("",
                                        "The checked date time is before the given one whereas it must not.",
                                        "The checked date time:", "\t[2013-12-25T00:00:00.0000000, Kind = Unspecified]",
                                        "The expected date time: after or equal", "\t[2013-12-31T00:00:00.0000000, Kind = Unspecified]");
        }