Exemple #1
0
        public void GrcApplyViolation( )
        {
            GenericRuleChecker <IList <string> > grc = new GenericRuleChecker <IList <string> >(
                new[] {
                new Implies <IList <string> >(new Contains <string>("hello"), new Contains <string>("world"))
            },
                new CList <string>( ));

            Assert.AreEqual(0, grc.Subject.Count);
            ApplicationResult <IList <string> > ar = grc.Apply(new Add <string>("hello"));

            Assert.IsNotNull(ar);
            Assert.IsTrue(ar.Successful);
            ar.Accept( );
            Assert.AreEqual(2, grc.Subject.Count);
            Assert.IsTrue(grc.Subject.Contains("hello"));
            Assert.IsTrue(grc.Subject.Contains("world"));
        }