Exemplo n.º 1
0
 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);
        }
Exemplo n.º 3
0
 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)
         }
     });
 }
Exemplo n.º 4
0
 public void Do(ArgModel argModel)
 {
 }
Exemplo n.º 5
0
 public void Model(ArgModel model)
 {
 }
 public void Do(ArgModel argModel)
 {
     TestOutputs.Capture(argModel);
 }