Esempio n. 1
0
 public void LengthLessThan4PropertyEqual3()
 {
     var o = GetJ(@"{ ""TheProperty"" : ""ABC"" }");
     LengthLessThan isnull = new LengthLessThan("TheProperty", 4);
     Assert.IsTrue(isnull.Evaluate(o));
 }
Esempio n. 2
0
 public void LengthLessThan1MissingNotImplicit()
 {
     var o = GetJ(@"{ }");
     LengthLessThan isnull = new LengthLessThan("TheProperty", 1, false, true);
     Assert.IsFalse(isnull.Evaluate(o));
 }
Esempio n. 3
0
 public void LengthLess4ThanPropertyEqual5()
 {
     var o = GetJ(@"{ ""TheProperty"" : ""ABCDE"" }");
     LengthLessThan isnull = new LengthLessThan("TheProperty", 4);
     Assert.IsFalse(isnull.Evaluate(o));
 }
Esempio n. 4
0
 public void LengthLessThan1MissingImplicit()
 {
     var o = GetJ(@"{ }");
     LengthLessThan isnull = new LengthLessThan("TheProperty", 1);
     Assert.IsTrue(isnull.Evaluate(o));
 }
 public void LengthLessThanNull()
 {
     LengthLessThan c = new LengthLessThan("TheProperty", 4);
     var j = GetJ(@"{""TheProperty"":null}");
     Assert.IsFalse(c.Evaluate(j));
     Assert.AreEqual(@"{""Name"":""Length"",""PropertyName"":""TheProperty"",""Kind"":""LessThan"",""MinimumLength"":4,""ActualLength"":0,""PropertyValue"":null,""PropertyHasValue"":true,""Description"":""The property 'TheProperty' was expected to be less than '4' characters.""}", c.GetState(j));
 }