当前位置: 首页>>代码示例>>C#>>正文


C# IRule.Execute方法代码示例

本文整理汇总了C#中IRule.Execute方法的典型用法代码示例。如果您正苦于以下问题:C# IRule.Execute方法的具体用法?C# IRule.Execute怎么用?C# IRule.Execute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IRule的用法示例。


在下文中一共展示了IRule.Execute方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: WhenNoOrdersAreFoundThenNothingIsReturned

        public void WhenNoOrdersAreFoundThenNothingIsReturned()
        {
            rule = new MultipleOrderRule(map, dishes2, output);
            rule.Execute();

            Assert.AreEqual(0, output.Count);
        }
开发者ID:knovak72,项目名称:MealTime,代码行数:7,代码来源:MultipleOrderDishRuleTestFixture.cs

示例2: WhenASingleDishIsPresentThenTheOutputAccountsForThat

        public void WhenASingleDishIsPresentThenTheOutputAccountsForThat()
        {
            dishes2.Add(3);

            rule = new MultipleOrderRule(map, dishes2, output);
            rule.Execute();

            Assert.AreEqual(1, output.Count);
            Assert.AreEqual("coffee", output[0]);
        }
开发者ID:knovak72,项目名称:MealTime,代码行数:10,代码来源:MultipleOrderDishRuleTestFixture.cs

示例3: GivenASingleEntreeThenTheResultsAccountForThatFact

        public void GivenASingleEntreeThenTheResultsAccountForThatFact()
        {
            dishes = new List<int>() { 1 };
            output = new List<string>();

            rule = new SingleOrderRule(map, dishes, output);
            rule.Execute();

            Assert.AreEqual(1, output.Count);
            Assert.AreEqual("eggs", output[0]);
        }
开发者ID:knovak72,项目名称:MealTime,代码行数:11,代码来源:SingleOrderDishRuleTestFixture.cs

示例4: WhenAnEntreeSideAndDrinkExistThenTheResultsReflectThatFact

        public void WhenAnEntreeSideAndDrinkExistThenTheResultsReflectThatFact()
        {
            dishes.Add(1);
            dishes.Add(2);
            dishes.Add(3);

            rule = mealFactory.GetRules(map, dishes, output);
            rule.Execute();

            Assert.AreEqual(3, output.Count);
            Assert.AreEqual("eggs", output[0]);
            Assert.AreEqual("toast", output[1]);
            Assert.AreEqual("coffee", output[2]);
        }
开发者ID:knovak72,项目名称:MealTime,代码行数:14,代码来源:BreakfastRuleFactoryTestFixture.cs

示例5: WhenAnEntreeSideAndDrinkAreOutOfOrderTheResultsAreReturnedInTheCorrectOrder

        public void WhenAnEntreeSideAndDrinkAreOutOfOrderTheResultsAreReturnedInTheCorrectOrder()
        {
            dishes.Add(2);
            dishes.Add(1);
            dishes.Add(3);

            rule = mealFactory.GetRules(map, dishes, output);
            rule.Execute();

            Assert.AreEqual(3, output.Count);
            Assert.AreEqual("eggs", output[0]);
            Assert.AreEqual("toast", output[1]);
            Assert.AreEqual("coffee", output[2]);
        }
开发者ID:knovak72,项目名称:MealTime,代码行数:14,代码来源:BreakfastRuleFactoryTestFixture.cs

示例6: WhenAnEntreeSideDrinkAndDessertExistsThenTheResultsReflectThatFact

        public void WhenAnEntreeSideDrinkAndDessertExistsThenTheResultsReflectThatFact()
        {
            dishes.Add(1);
            dishes.Add(2);
            dishes.Add(3);
            dishes.Add(4);

            rule = mealFactory.GetRules(map, dishes, output);
            rule.Execute();

            Assert.AreEqual(4, output.Count);
            Assert.AreEqual("steak", output[0]);
            Assert.AreEqual("potato", output[1]);
            Assert.AreEqual("wine", output[2]);
            Assert.AreEqual("cake", output[3]);
        }
开发者ID:knovak72,项目名称:MealTime,代码行数:16,代码来源:DinnerRuleFactoryTestFixture.cs

示例7: GivenMultipleBreakfastEntreesThenTheOutputAccountsForThat

        public void GivenMultipleBreakfastEntreesThenTheOutputAccountsForThat()
        {
            dishes.Add(1);
            dishes.Add(1);

            rule = new SingleOrderRule(map, dishes, output);
            try
            {
                rule.Execute();
            }
            catch (Exception e)
            {
                Debug.WriteLine(e.Message);
            }

            Assert.AreEqual(2, output.Count);
            Assert.AreEqual("eggs", output[0]);
            Assert.AreEqual("error", output[1]);
        }
开发者ID:knovak72,项目名称:MealTime,代码行数:19,代码来源:SingleOrderDishRuleTestFixture.cs

示例8: WhenAnEntreeSideDrinkAndInvalidRequestExistThenTheResultsReflectThatFact

        public void WhenAnEntreeSideDrinkAndInvalidRequestExistThenTheResultsReflectThatFact()
        {
            dishes.Add(1);
            dishes.Add(2);
            dishes.Add(3);
            dishes.Add(5);

            rule = mealFactory.GetRules(map, dishes, output);

            try
            {
                rule.Execute();
            }
            catch (Exception e)
            {
                Debug.WriteLine(e.Message);
            }

            Assert.AreEqual(4, output.Count);
            Assert.AreEqual("steak", output[0]);
            Assert.AreEqual("potato", output[1]);
            Assert.AreEqual("wine", output[2]);
            Assert.AreEqual("error", output[3]);
        }
开发者ID:knovak72,项目名称:MealTime,代码行数:24,代码来源:DinnerRuleFactoryTestFixture.cs

示例9: RunUnitTest

 private static void RunUnitTest(IRule rule, ResultType resultType)
 {
     Assert.That(rule.Execute().Type, Is.EqualTo(resultType));
 }
开发者ID:tuvoksg1,项目名称:RulesEngine,代码行数:4,代码来源:NumberRules.cs

示例10: WhenAnEntreeSideDrinkAndOtherDishExistThenTheResultsReflectThatFact

        public void WhenAnEntreeSideDrinkAndOtherDishExistThenTheResultsReflectThatFact()
        {
            dishes.Add(2);
            dishes.Add(1);
            dishes.Add(3);
            dishes.Add(4);

            rule = mealFactory.GetRules(map, dishes, output);

            try
            {
                rule.Execute();
            }
            catch (Exception e)
            {
                Debug.WriteLine(e.Message);
            }

            Assert.AreEqual(4, output.Count);
            Assert.AreEqual("eggs", output[0]);
            Assert.AreEqual("toast", output[1]);
            Assert.AreEqual("coffee", output[2]);
            Assert.AreEqual("error", output[3]);
        }
开发者ID:knovak72,项目名称:MealTime,代码行数:24,代码来源:BreakfastRuleFactoryTestFixture.cs

示例11: WhenTwoEntreesExistThenTheResultsReflectThatFact

        public void WhenTwoEntreesExistThenTheResultsReflectThatFact()
        {
            dishes.Add(1);
            dishes.Add(1);

            rule = mealFactory.GetRules(map, dishes, output);
            try
            {
                rule.Execute();
            }
            catch (Exception e)
            {
                Debug.WriteLine(e.Message);
            }

            Assert.AreEqual(2, output.Count);
            Assert.AreEqual("eggs", output[0]);
            Assert.AreEqual("error", output[1]);
        }
开发者ID:knovak72,项目名称:MealTime,代码行数:19,代码来源:BreakfastRuleFactoryTestFixture.cs

示例12: WhenTwoEntreesExistThenAnExceptionIsThrown

        public void WhenTwoEntreesExistThenAnExceptionIsThrown()
        {
            dishes.Add(1);
            dishes.Add(1);

            rule = mealFactory.GetRules(map, dishes, output);
            rule.Execute();
        }
开发者ID:knovak72,项目名称:MealTime,代码行数:8,代码来源:BreakfastRuleFactoryTestFixture.cs

示例13: WhenNoDishesExistThenNothingIsPrinted

        public void WhenNoDishesExistThenNothingIsPrinted()
        {
            IList<int> dishes = new List<int>();

            rule = mealFactory.GetRules(map, dishes, output);
            rule.Execute();

            Assert.AreEqual(0, output.Count);
        }
开发者ID:knovak72,项目名称:MealTime,代码行数:9,代码来源:BreakfastRuleFactoryTestFixture.cs

示例14: WhenASingleEntreeExistsThenTheResultsReflectThatFact

        public void WhenASingleEntreeExistsThenTheResultsReflectThatFact()
        {
            dishes.Add(1);

            rule = mealFactory.GetRules(map, dishes, output);
            rule.Execute();

            Assert.AreEqual(1, output.Count);
            Assert.AreEqual("eggs", output[0]);
        }
开发者ID:knovak72,项目名称:MealTime,代码行数:10,代码来源:BreakfastRuleFactoryTestFixture.cs

示例15: RunUnitTest

 private static void RunUnitTest(IRule rule, ResultType expectedResult)
 {
     Assert.That(rule.Execute().Type, Is.EqualTo(expectedResult));
 }
开发者ID:tuvoksg1,项目名称:RulesEngine,代码行数:4,代码来源:DateRules.cs


注:本文中的IRule.Execute方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。