コード例 #1
0
ファイル: ConstraintTests.cs プロジェクト: aidancasey/Moksy
 public void LengthPropertyNameNull()
 {
     var o = GetJ(@"{ ""TheProperty"" : null }");
     LengthEquals isnull = new LengthEquals(null, 0);
     Assert.IsFalse(isnull.Evaluate(o));
 }
コード例 #2
0
ファイル: ConstraintTests.cs プロジェクト: aidancasey/Moksy
 public void LengthPropertyNullNotImplicit()
 {
     var o = GetJ(@"{ ""TheProperty"" : null }");
     LengthEquals isnull = new LengthEquals("TheProperty", 0, false, false);
     Assert.IsFalse(isnull.Evaluate(o));
 }
コード例 #3
0
ファイル: ConstraintTests.cs プロジェクト: aidancasey/Moksy
 public void LengthJobNull()
 {
     LengthEquals isnull = new LengthEquals("TheProperty", 0);
     Assert.IsFalse(isnull.Evaluate(null));
     Assert.AreEqual(0, isnull.ActualLength);
 }
コード例 #4
0
ファイル: ConstraintTests.cs プロジェクト: aidancasey/Moksy
 public void LengthEqualsPropertyEqual4()
 {
     var o = GetJ(@"{ ""TheProperty"" : ""ABCD"" }");
     LengthEquals isnull = new LengthEquals("TheProperty", 0);
     Assert.IsFalse(isnull.Evaluate(o));
 }
コード例 #5
0
ファイル: ConstraintTests.cs プロジェクト: aidancasey/Moksy
 public void LengthEqualsMissingNotImplicit()
 {
     var o = GetJ(@"{ }");
     LengthEquals isnull = new LengthEquals("TheProperty", 0, false, true);
     Assert.IsFalse(isnull.Evaluate(o));
 }
コード例 #6
0
ファイル: ConstraintTests.cs プロジェクト: aidancasey/Moksy
 public void LengthEqualsMissingImplicit()
 {
     var o = GetJ(@"{ }");
     LengthEquals isnull = new LengthEquals("TheProperty", 0);
     Assert.IsTrue(isnull.Evaluate(o));
 }
コード例 #7
0
 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));
 }