コード例 #1
0
ファイル: ConstraintTests.cs プロジェクト: aidancasey/Moksy
 public void LengthNotEqualsPropertyEqual12()
 {
     var o = GetJ(@"{ ""TheProperty"" : ""AB"" }");
     LengthNotEquals isnull = new LengthNotEquals("TheProperty", 1);
     Assert.IsTrue(isnull.Evaluate(o));
 }
コード例 #2
0
ファイル: ConstraintTests.cs プロジェクト: aidancasey/Moksy
 public void LengthNotEquals0NullImplicit()
 {
     var o = GetJ(@"{""TheProperty"":null}");
     LengthNotEquals isnull = new LengthNotEquals("TheProperty", 0);
     Assert.IsFalse(isnull.Evaluate(o));
 }
コード例 #3
0
 public void LengthNotEqualsTrue()
 {
     LengthLessThanOrGreaterThan c = new LengthNotEquals("TheProperty", 4);
     var j = GetJ(@"{""TheProperty"":""ABCD""}");
     Assert.IsFalse(c.Evaluate(j));
     Assert.AreEqual(@"{""Name"":""Length"",""PropertyName"":""TheProperty"",""Kind"":""NotEquals"",""ExpectedLength"":4,""ActualLength"":4,""PropertyValue"":""ABCD"",""PropertyHasValue"":true,""Description"":""The property 'TheProperty' was expected to not be of length '4'.""}", c.GetState(j));
 }
コード例 #4
0
ファイル: ConstraintTests.cs プロジェクト: aidancasey/Moksy
 public void LengthNotEquals0MissingExplicit()
 {
     var o = GetJ(@"{}");
     LengthNotEquals isnull = new LengthNotEquals("TheProperty", 0, false, true);
     Assert.IsTrue(isnull.Evaluate(o));
 }
コード例 #5
0
 public void LengthNotEqualsMissing()
 {
     LengthNotEquals c = new LengthNotEquals("TheProperty", 4);
     var j = GetJ(@"{}");
     Assert.IsTrue(c.Evaluate(j));
     Assert.AreEqual(@"{""Name"":""Length"",""PropertyName"":""TheProperty"",""Kind"":""NotEquals"",""ExpectedLength"":4,""ActualLength"":0,""PropertyValue"":null,""PropertyHasValue"":false,""Description"":""The property 'TheProperty' was expected to not be of length '4'.""}", c.GetState(j));
 }