本文整理汇总了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"
);
}
示例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));
}
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}