public void GetInstance_echo() { var target = new NinjectHandlerSource(null, null); var handlers = new HandlerSourceCollection(new[] { target }, new AliasMap()); var state = new EngineState(true, new EngineEventCatalog(), new EngineSettings()); var dispatcher = new CommandDispatcher(CommandParser.GetDefault(), handlers, new InstanceEnvironmentCollection(null), state, new ConsoleOutput()); var result = target.GetInstance(Command.Create("echo", SyntheticArguments.Empty()), dispatcher); result.Should().BeOfType <EchoHandler>(); }
public void Environment_Test() { var target = new NinjectHandlerSource(null, null); var handlers = new HandlerSourceCollection(new[] { target }, new AliasMap()); var environments = new InstanceEnvironmentCollection(new TestEnvironment("test")); var state = new EngineState(true, new EngineEventCatalog(), new EngineSettings()); var dispatcher = new CommandDispatcher(CommandParser.GetDefault(), handlers, environments, state, new ConsoleOutput()); var result = target.GetInstance(Command.Create("test-environment", SyntheticArguments.Empty()), dispatcher) as EnvironmentInjectionTestHandler; result.Should().NotBeNull(); result.Environment.Should().NotBeNull(); result.Environment.Should().BeOfType <TestEnvironment>(); }
public void Get_Index_TooHigh() { var target = SyntheticArguments.Empty(); target.Get(0).Should().BeOfType <MissingArgument>(); }
public void Empty_Test() { var target = SyntheticArguments.Empty(); target.GetAllArguments().Count().Should().Be(0); }