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


C# StandardKernel.FindRunner方法代码示例

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


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

示例1: runner

        public void _陳列された商品の表示依頼を処理する_釣り銭切れが解消するまでは購入不可となる場合()
        {
            var repo = new Ninject.StandardKernel()
                .BindNoChangeContext()
                .BindRunnerRepository()
                .Get<IRunnerRepository>()
            ;

            Assert.That(repo.PurchaseContext.ReceivedTotal, Is.EqualTo(0));

            Action runner;

            runner = repo.FindRunner(new MoneyInsertionParseResult {Money = Money.Coin500, Count=1}, null);
            runner();

            this.TestShowItemCore(repo,
                "       # Name                     Price",
                "-----+--+------------------------+------",
                " [!]   1 Item0...................   120",
                " [x]   2 ........................      ",
                " [!]   3 Item2...................   250"
            );

            runner = repo.FindRunner(new MoneyInsertionParseResult {Money = Money.Coin100, Count=1}, null);
            runner();
            runner = repo.FindRunner(new MoneyInsertionParseResult {Money = Money.Coin10, Count=3}, null);
            runner();

            this.TestShowItemCore(repo,
                "       # Name                     Price",
                "-----+--+------------------------+------",
                " [*]   1 Item0...................   120",
                " [x]   2 ........................      ",
                " [!]   3 Item2...................   250"
            );
        }
开发者ID:posaunehm,项目名称:Codersation,代码行数:36,代码来源:ParserTest.cs

示例2: foreach

        public void _陳列された商品の表示依頼を処理する_受け付けない金種を投入した場合()
        {
            var repo = new Ninject.StandardKernel()
                .BindPurchaseContextContainingSoldout()
                .BindRunnerRepository()
                .Get<IRunnerRepository>()
            ;

            Assert.That(repo.PurchaseContext.ReceivedTotal, Is.EqualTo(0));

            Action runner;
            var fixtures = new _コマンドパーサに渡すTestFixture().InvalidInsMoneyParams;
            foreach (var param in fixtures.Select(f => f.Expected)) {
                var expected = new string[] {
                    "       # Name                     Price",
                    "-----+--+------------------------+------",
                    " [ ]   1 Item0...................   300",
                    " [ ]   2 Item1...................  1200",
                    " [-]   3 Item2...................   900",
                    " [ ]   4 Item3...................   600"
                };
                var it = expected.GetEnumerator();

                runner = repo.FindRunner(param, null);
                runner();

                runner = repo.FindRunner(new ShowItemParseResult(), (message) => {
                    Assert.That(it.MoveNext(), Is.True);
                    Assert.That(message, Is.EqualTo(it.Current));
                });
                runner();

                Assert.That(it.MoveNext(), Is.False);
                Assert.That(repo.PurchaseContext.ReceivedTotal, Is.EqualTo(0));
            }
        }
开发者ID:posaunehm,项目名称:Codersation,代码行数:36,代码来源:ParserTest.cs

示例3: ShowItemParseResult

        public void _陳列された商品の表示依頼を処理する_未入金の場合()
        {
            var repo = new Ninject.StandardKernel()
                .BindPurchaseContextContainingSoldout()
                .BindRunnerRepository()
                .Get<IRunnerRepository>()
            ;

            Assert.That(repo.PurchaseContext.ReceivedTotal, Is.EqualTo(0));

            var expected = new string[] {
                "       # Name                     Price",
                "-----+--+------------------------+------",
                " [ ]   1 Item0...................   300",
                " [ ]   2 Item1...................  1200",
                " [-]   3 Item2...................   900",
                " [ ]   4 Item3...................   600"
            };

            var it = expected.GetEnumerator();

            var runner = repo.FindRunner(new ShowItemParseResult(), (message) => {
                Assert.That(it.MoveNext(), Is.True);
                Assert.That(message, Is.EqualTo(it.Current));
            });
            runner();

            Assert.That(repo.PurchaseContext.ReceivedTotal, Is.EqualTo(0));
            Assert.That(it.MoveNext(), Is.False);
        }
开发者ID:posaunehm,项目名称:Codersation,代码行数:30,代码来源:ParserTest.cs

示例4: ShowAmountParseResult

        public void _投入合計金額表示を処理する_未入金の場合()
        {
            var repo = new Ninject.StandardKernel()
                .BindPurchaseContext()
                    .BindRunnerRepository()
                    .Get<IRunnerRepository>()
                ;

            Assert.That(repo.PurchaseContext.ReceivedTotal, Is.EqualTo(0));

            var passed = false;
            var runner = repo.FindRunner(new ShowAmountParseResult(), (message) => {
                Assert.That(message, Is.EqualTo("Not received."));
                passed = true;
            });
            runner();

            Assert.That(repo.PurchaseContext.ReceivedTotal, Is.EqualTo(0));
            Assert.That(passed, Is.True);
        }
开发者ID:posaunehm,项目名称:Codersation,代码行数:20,代码来源:ParserTest.cs

示例5: HelpParseResult

        public void _ヘルプ表示依頼を処理する()
        {
            var repo = new Ninject.StandardKernel()
                .BindPurchaseContext()
                .BindRunnerRepository()
                .Get<IRunnerRepository>()
            ;

            var it = ConsoleTestHelper.ListExpectedHelpContents().GetEnumerator();

            var runner = repo.FindRunner(new HelpParseResult(), (message) => {
                Assert.That(it.MoveNext(), Is.True);
                Assert.That(message, Is.Not.Null.And.Not.Empty);
                Assert.That(message, Is.EqualTo(it.Current));
            });

            runner();

            Assert.That(it.MoveNext(), Is.False);
        }
开发者ID:posaunehm,项目名称:Codersation,代码行数:20,代码来源:ParserTest.cs

示例6: MoneyEjectParseResult

        public void _お金の排出依頼を処理する_入金がない場合()
        {
            var repo = new Ninject.StandardKernel()
                .BindPurchaseContext()
                    .BindRunnerRepository()
                    .Get<IRunnerRepository>()
                    ;

            Assert.That(repo.PurchaseContext.ReceivedTotal, Is.EqualTo(0));

            var passed = false;
            var runner = repo.FindRunner(new MoneyEjectParseResult(), (message) => {
                Assert.That(message, Is.EqualTo("money is not inserted."));
                passed = true;
            });
            runner();

            Assert.That(repo.PurchaseContext.ReceivedTotal, Is.EqualTo(0));

            Assert.That(passed, Is.True);
        }
开发者ID:posaunehm,项目名称:Codersation,代码行数:21,代码来源:ParserTest.cs


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