Exemple #1
0
 public void LengthLtgt47PropertyEqual8()
 {
     var o = GetJ(@"{ ""TheProperty"" : ""ABCDEFGH"" }");
     LengthLessThanOrGreaterThan isnull = new LengthLessThanOrGreaterThan("TheProperty", 4, 7);
     Assert.IsTrue(isnull.Evaluate(o));
     Assert.AreEqual(8, isnull.ActualLength);
 }
Exemple #2
0
 public void LengthLtgt17PropertyNullNotImplicit()
 {
     var o = GetJ(@"{""TheProperty"":null}");
     LengthLessThanOrGreaterThan isnull = new LengthLessThanOrGreaterThan("TheProperty", 1, 7, false, false);
     Assert.IsFalse(isnull.Evaluate(o));
     Assert.AreEqual(0, isnull.ActualLength);
 }
Exemple #3
0
 public void LengthLtgt17PropertyMissingImplicit()
 {
     var o = GetJ(@"{}");
     LengthLessThanOrGreaterThan isnull = new LengthLessThanOrGreaterThan("TheProperty", 1, 7);
     Assert.IsTrue(isnull.Evaluate(o));
     Assert.AreEqual(0, isnull.ActualLength);
 }
Exemple #4
0
 public void LengthLtgt07PropertyNullImplicit()
 {
     var o = GetJ(@"{""TheProperty"":null}");
     LengthLessThanOrGreaterThan isnull = new LengthLessThanOrGreaterThan("TheProperty", 0, 7);
     Assert.IsTrue(isnull.Evaluate(o));
     Assert.AreEqual(0, isnull.ActualLength);
 }
Exemple #5
0
 public void LengthLtgt07PropertyMissingNotImplicit()
 {
     var o = GetJ(@"{}");
     LengthLessThanOrGreaterThan isnull = new LengthLessThanOrGreaterThan("TheProperty", 0, 7, false, true);
     Assert.IsFalse(isnull.Evaluate(o));
     Assert.AreEqual(0, isnull.ActualLength);
 }
 public void LengthLtGtNull0()
 {
     LengthLessThanOrGreaterThan c = new LengthLessThanOrGreaterThan("TheProperty", 0, 8);
     var j = GetJ(@"{""TheProperty"":null}");
     Assert.IsTrue(c.Evaluate(j));
     Assert.AreEqual(@"{""Name"":""Length"",""PropertyName"":""TheProperty"",""Kind"":""LessThanOrGreaterThan"",""MinimumLength"":0,""MaximumLength"":8,""ActualLength"":0,""PropertyValue"":null,""PropertyHasValue"":true,""Description"":""The property 'TheProperty' was expected to be less than '0' characters or greater than '8' characters in length.""}", c.GetState(j));
 }