Пример #1
0
        public void InvokingSimpleNestedRuleWithValidWordSequenceShouldSucceed()
        {
            _grammar.AddRule("outer", e => e
                             .Say("Something").WithRule("inner")
                             );
            _grammar.AddRule("inner", e => e
                             .Say("Good")
                             );

            _grammar.ActivateRule("outer");
            _grammar.InvokeRule(new [] { "Something", "Good" });
        }
Пример #2
0
        public void ComplexRuleActionShouldBeInvoked_Variant1()
        {
            _grammar.InitializeRule3();
            _grammar.ActivateRule("test_rule_03");
            _grammar.InvokeRule(new[] { "Hello", "Skee", "Sty", "Sty", "Hi", "Hi", "Sty" });

            Assert.That(rule3Result, Is.EqualTo(1));
        }