示例#1
0
        public void executes_expected_help_command()
        {
            var sut = new CleeEngineBuilder().Build();
            sut.Execute("help");

            Assert.Equal("help", sut.History.Single().CommandName);
            Assert.Equal(typeof(HelpCommand), sut.History.Single().ImplementationType);
        }
示例#2
0
        public void writes_expected_to_output_when_executed()
        {
            var spyOutputWriter = new SpyOutputWriter();

            var sut = new CleeEngineBuilder().Build();
            sut.SetOutputWriter(spyOutputWriter);

            sut.Execute("help");

            Assert.StartsWith("Usage", spyOutputWriter.Output.ToString());
        }
示例#3
0
        public void help_command_is_executed_if_no_command_is_specified_from_the_commandline_1_1()
        {
            var sut = new CleeEngineBuilder().Build();
            sut.Execute((string)null);

            Assert.Equal("help", sut.History.Single().CommandName);
        }
示例#4
0
 public void default_engine_returns_expected_registry()
 {
     var engine = new CleeEngineBuilder().Build();
     Assert.IsType<DefaultCommandRegistry>(engine.Registry);
 }
示例#5
0
 public void default_engine_returns_expected_mapper()
 {
     var engine = new CleeEngineBuilder().Build();
     Assert.IsType<DefaultArgumentMapper>(engine.Mapper);
 }
示例#6
0
 public void default_engine_returns_expected_factort()
 {
     var engine = new CleeEngineBuilder().Build();
     Assert.IsType<DefaultCommandFactory>(engine.Factory);
 }
示例#7
0
        public void help_command_is_executed_if_no_command_is_specified_from_the_commandline_3_1()
        {
            var sut = new CleeEngineBuilder().Build();
            sut.Execute(
                    commandName: null,
                    args: new Argument[0]
                );

            Assert.Equal("help", sut.History.Single().CommandName);
        }