コード例 #1
0
        public void RubberStamp_Conditions_CustomPropertyCondition_String_Valid_Test()
        {
            var condition = new CustomPropertyCondition <TestClass, string>(c => c.Name, (c, p) => p != null);

            Assert.IsTrue(condition.IsValid(new TestClass {
                Name = "TEST"
            }));
        }
コード例 #2
0
        public void RubberStamp_Conditions_CustomPropertyCondition_Int_Invalid_Test()
        {
            var condition = new CustomPropertyCondition <TestClass, int>(c => c.Index, (c, p) => p > 0);

            Assert.IsFalse(condition.IsValid(new TestClass {
                Index = 0
            }));
        }