コード例 #1
0
ファイル: ConstraintsTest.cs プロジェクト: limiha/FieldWorks
        public void PropertyIsWithNestedProperties()
        {
            ThingWithProps t = new ThingWithProps();

            Assertion.Assert(new PropertyIs("MyProp.Length", 5).Eval(t));
            Assertion.Assert(!new PropertyIs("MyProp.Length", 9).Eval(t));
        }
コード例 #2
0
ファイル: ConstraintsTest.cs プロジェクト: limiha/FieldWorks
        public void PropertyIs()
        {
            ThingWithProps t = new ThingWithProps();

            // test property equals a value
            Assertion.Assert(new PropertyIs("MyProp", "hello").Eval(t));
            Assertion.Assert(!new PropertyIs("MyProp", "bye").Eval(t));

            // test property using another constraint
            Assertion.Assert(new PropertyIs("MyProp", new IsMatch("ell")).Eval(t));
            Assertion.Assert(!new PropertyIs("MyProp", new IsMatch("sfsl")).Eval(t));

            Assertion.AssertEquals(
                "Property MyProp: <x>",
                new PropertyIs("MyProp", new IsEqual("x")).Message);
        }
コード例 #3
0
ファイル: ConstraintsTest.cs プロジェクト: bbriggs/FieldWorks
		public void PropertyIsWithNestedProperties()
		{
			ThingWithProps t = new ThingWithProps();

			Assertion.Assert(new PropertyIs("MyProp.Length", 5).Eval(t));
			Assertion.Assert(!new PropertyIs("MyProp.Length", 9).Eval(t));
		}
コード例 #4
0
ファイル: ConstraintsTest.cs プロジェクト: bbriggs/FieldWorks
		public void PropertyIs()
		{
			ThingWithProps t = new ThingWithProps();

			// test property equals a value
			Assertion.Assert(new PropertyIs("MyProp", "hello").Eval(t));
			Assertion.Assert(!new PropertyIs("MyProp", "bye").Eval(t));

			// test property using another constraint
			Assertion.Assert(new PropertyIs("MyProp", new IsMatch("ell")).Eval(t));
			Assertion.Assert(!new PropertyIs("MyProp", new IsMatch("sfsl")).Eval(t));

			Assertion.AssertEquals(
				"Property MyProp: <x>",
				new PropertyIs("MyProp", new IsEqual("x")).Message);
		}