Пример #1
0
 public void InOrderAtLeastPrimitiveIntItemsPass()
 {
     AssertPasses(
         Items(1, 2, 3),
         AList.InOrder().WithAtLeast(AnInt.EqualTo(1))
         );
 }
Пример #2
0
        public void AsIntTest()
        {
            AssertPasses("0", AString.As(AnInt.EqualTo(0)));
            AssertPasses("1", AString.As(AnInt.EqualTo(1)));
            AssertPasses("999", AString.As(AnInt.GreaterThan(50)));

            AssertFails((string)null, AString.As(AnInt.EqualTo(0)));
            AssertFails("", AString.As(AnInt.EqualTo(0)));
            AssertFails(" ", AString.As(AnInt.EqualTo(0)));
            AssertFails("zero", AString.As(AnInt.EqualTo(0)));
        }
 public void MissMatchingPropertyTest()
 {
     AssertFails(
         new FooPoco()
     {
         StringProp = "MyString", IntProp = 1
     },
         ExpectFoo()
         .WithProperty("StringProp", AString.EqualTo("MyWrongString"))
         .WithProperty("IntProp", AnInt.EqualTo(1))
         );
 }
 public void AllPropertiesMatchesTest()
 {
     AssertPasses(
         new FooPoco()
     {
         StringProp = "MyString", IntProp = 1
     },
         ExpectFoo()
         .WithProperty("StringProp", AString.EqualTo("MyString"))
         .WithProperty("IntProp", AnInt.EqualTo(1))
         );
 }
Пример #5
0
        public void TrimmedLengthTest()
        {
            AssertPasses(null, AString.TrimmedLength(AnInt.EqualTo(0)));
            AssertPasses("", AString.TrimmedLength(AnInt.EqualTo(0)));
            AssertPasses(" ", AString.TrimmedLength(AnInt.EqualTo(0)));
            AssertPasses(" a ", AString.TrimmedLength(AnInt.EqualTo(1)));
            AssertPasses(" a b ", AString.TrimmedLength(AnInt.EqualTo(3)));

            AssertFails(null, AString.TrimmedLength(AnInt.EqualTo(1)));
            AssertFails("", AString.TrimmedLength(AnInt.EqualTo(1)));
            AssertFails(" ", AString.TrimmedLength(AnInt.EqualTo(1)));
            AssertFails(" a ", AString.TrimmedLength(AnInt.EqualTo(0)));
            AssertFails(" a ", AString.TrimmedLength(AnInt.EqualTo(2)));
            AssertFails(" a b ", AString.TrimmedLength(AnInt.EqualTo(1)));
        }
Пример #6
0
 public TSelf NumResults(int val)
 {
     NumResults(AnInt.EqualTo(val));
     return(Self());
 }
Пример #7
0
 public void EqualToTest()
 {
     AssertFails(4, AnInt.EqualTo(5));
     AssertPasses(5, AnInt.EqualTo(5));
     AssertFails(6, AnInt.EqualTo(5));
 }
Пример #8
0
 public ATestDtoEnumerable Count(int expect)
 {
     Count(AnInt.EqualTo(expect));
     return(this);
 }
Пример #9
0
 public ATestDtoEnumerable Capacity(int expect)
 {
     Capacity(AnInt.EqualTo(expect));
     return(this);
 }
Пример #10
0
 public ATestDto MyPrimIntProp(int expect)
 {
     MyPrimIntProp(AnInt.EqualTo(expect));
     return(this);
 }
Пример #11
0
 public ATestDto MyNullIntProp(int?expect)
 {
     MyNullIntProp(AnInt.EqualTo(expect));
     return(this);
 }