當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。