public void InOrderAtLeastPrimitiveIntItemsPass() { AssertPasses( Items(1, 2, 3), AList.InOrder().WithAtLeast(AnInt.EqualTo(1)) ); }
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)) ); }
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))); }
public TSelf NumResults(int val) { NumResults(AnInt.EqualTo(val)); return(Self()); }
public void EqualToTest() { AssertFails(4, AnInt.EqualTo(5)); AssertPasses(5, AnInt.EqualTo(5)); AssertFails(6, AnInt.EqualTo(5)); }
public ATestDtoEnumerable Count(int expect) { Count(AnInt.EqualTo(expect)); return(this); }
public ATestDtoEnumerable Capacity(int expect) { Capacity(AnInt.EqualTo(expect)); return(this); }
public ATestDto MyPrimIntProp(int expect) { MyPrimIntProp(AnInt.EqualTo(expect)); return(this); }
public ATestDto MyNullIntProp(int?expect) { MyNullIntProp(AnInt.EqualTo(expect)); return(this); }