Example #1
0
 public void LengthPropertyNameNull()
 {
     var o = GetJ(@"{ ""TheProperty"" : null }");
     LengthEquals isnull = new LengthEquals(null, 0);
     Assert.IsFalse(isnull.Evaluate(o));
 }
Example #2
0
 public void LengthPropertyNullNotImplicit()
 {
     var o = GetJ(@"{ ""TheProperty"" : null }");
     LengthEquals isnull = new LengthEquals("TheProperty", 0, false, false);
     Assert.IsFalse(isnull.Evaluate(o));
 }
Example #3
0
 public void LengthJobNull()
 {
     LengthEquals isnull = new LengthEquals("TheProperty", 0);
     Assert.IsFalse(isnull.Evaluate(null));
     Assert.AreEqual(0, isnull.ActualLength);
 }
Example #4
0
 public void LengthEqualsPropertyEqual4()
 {
     var o = GetJ(@"{ ""TheProperty"" : ""ABCD"" }");
     LengthEquals isnull = new LengthEquals("TheProperty", 0);
     Assert.IsFalse(isnull.Evaluate(o));
 }
Example #5
0
 public void LengthEqualsMissingNotImplicit()
 {
     var o = GetJ(@"{ }");
     LengthEquals isnull = new LengthEquals("TheProperty", 0, false, true);
     Assert.IsFalse(isnull.Evaluate(o));
 }
Example #6
0
 public void LengthEqualsMissingImplicit()
 {
     var o = GetJ(@"{ }");
     LengthEquals isnull = new LengthEquals("TheProperty", 0);
     Assert.IsTrue(isnull.Evaluate(o));
 }
 public void LengthEqualsTrue()
 {
     LengthEquals c = new LengthEquals("TheProperty", 4);
     var j = GetJ(@"{""TheProperty"":""ABCD""}");
     Assert.IsTrue(c.Evaluate(j));
     Assert.AreEqual(@"{""Name"":""Length"",""PropertyName"":""TheProperty"",""Kind"":""Equals"",""ExpectedLength"":4,""ActualLength"":4,""PropertyValue"":""ABCD"",""PropertyHasValue"":true,""Description"":""The property 'TheProperty' was expected to be of length '4'.""}", c.GetState(j));
 }