示例#1
0
        public void TestRules()
        {
            {
                AttributeType test = new AttributeType("test", typeof(SByte));
                CollectionAssert.IsEmpty(test.Rules);

                SimpleAttributeRule rule = new SimpleAttributeRule();
                test.AddRule(rule);

                CollectionAssert.Contains(test.Rules, rule);
                Assert.False(rule.Validated);
                test.Validate(null, null);
                Assert.True(rule.Validated);
            }
        }