public void LengthPropertyNameNull() { var o = GetJ(@"{ ""TheProperty"" : null }"); LengthEquals isnull = new LengthEquals(null, 0); Assert.IsFalse(isnull.Evaluate(o)); }
public void LengthPropertyNullNotImplicit() { var o = GetJ(@"{ ""TheProperty"" : null }"); LengthEquals isnull = new LengthEquals("TheProperty", 0, false, false); Assert.IsFalse(isnull.Evaluate(o)); }
public void LengthJobNull() { LengthEquals isnull = new LengthEquals("TheProperty", 0); Assert.IsFalse(isnull.Evaluate(null)); Assert.AreEqual(0, isnull.ActualLength); }
public void LengthEqualsPropertyEqual4() { var o = GetJ(@"{ ""TheProperty"" : ""ABCD"" }"); LengthEquals isnull = new LengthEquals("TheProperty", 0); Assert.IsFalse(isnull.Evaluate(o)); }
public void LengthEqualsMissingNotImplicit() { var o = GetJ(@"{ }"); LengthEquals isnull = new LengthEquals("TheProperty", 0, false, true); Assert.IsFalse(isnull.Evaluate(o)); }
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)); }