public void ShouldUseModelFromDependencyResolver() { var argModel = new ArgModel { Text = "some default" }; var result = new AppRunner <App>() .UseDependencyResolver(new TestDependencyResolver { new App(), argModel }) .Verify(new Scenario { When = { Args = "Do lala" },
public void ShouldUseModelFromDependencyResolver() { var argModel = new ArgModel { Text = "some default" }; var testOutputs = new AppRunner <App>() .UseDependencyResolver(new TestDependencyResolver { new App(), argModel }) .RunInMem("Do lala", _testOutputHelper) .TestOutputs; var resolvedArgModel = testOutputs.Get <ArgModel>(); resolvedArgModel.Should().BeSameAs(argModel); }
public void ShouldUseModelFromDependencyResolver() { var argModel = new ArgModel { Text = "some default" }; var result = new AppRunner <App>() .UseDependencyResolver(new TestDependencyResolver { new App(), argModel }) .Verify(new Scenario { When = { Args = "Do lala" }, Then = { AssertContext = ctx => ctx.GetCommandInvocationInfo().ParameterValues.First().Should().BeSameAs(argModel) } }); }
public void Do(ArgModel argModel) { }
public void Model(ArgModel model) { }
public void Do(ArgModel argModel) { TestOutputs.Capture(argModel); }