Exemplo n.º 1
0
        public void AddRule_should_add_the_passed_rule_to_the_Rules_collection()
        {
            // arrange
            var rule = new Rule(Guid.Empty);

            // act
            _ruleBase.AddRule(rule);

            // assert
            Assert.Contains(rule, _ruleBase.Rules);
        }
Exemplo n.º 2
0
        public void AddTriggeredRule(string assertion)
        {
            var fact = new Fact()
            {
                Assertion = assertion
            };
            var precondition = new ContainsPrecondition.Builder().WithFact(fact).Build();
            var rule         = new Rule.Builder().Build();

            rule.AddPrecondition(precondition);
            rule.MarkAsTriggered();

            _ruleBase.AddRule(rule);
        }