예제 #1
0
파일: Asserts.cs 프로젝트: linven/TypeLess
 public ObjectAssertion IsInvalid()
 {
     return(ObjectAssertion.New(
                Name.If("Name2").IsLongerThan(5),
                Number.If("Number2").IsEqualTo(0)
                ));
 }
예제 #2
0
 ObjectAssertion CanDelete(A a)
 {
     return(ObjectAssertion.New(
                a.If().IsTrue(x => x.B == 1, "B must not be 1"),
                a.If().IsTrue(x => x.C == 2, "C must not be 2")
                ));
 }
예제 #3
0
파일: Asserts.cs 프로젝트: linven/TypeLess
 public ObjectAssertion IsInvalid()
 {
     return(ObjectAssertion.New(
                Name.If("Name1").IsLongerThan(6),
                Number.If("Number1").IsEqualTo(0),
                Prop.If("Prop").IsInvalid
                ));
 }
예제 #4
0
 ObjectAssertion CanUpdate(A a)
 {
     //this is not testing to see if something is invalid ... its testing validity
     return(ObjectAssertion.New(
                a.If().EvalPositive.IsTrue(x => x.B == 1, "B must be 1"),
                a.If().EvalPositive.IsTrue(x => x.C == 2, "C must be 2")
                ));
 }
예제 #5
0
 public ObjectAssertion IsInvalid()
 {
     return(ObjectAssertion.New(_mail.If("mail address").IsNull.IsNotValidEmail));
 }
예제 #6
0
 public static void OrThrow(this ObjectAssertion assertion, string location, Func <string> func)
 {
     assertion.OrThrow(() => withLocation(location, func));
 }