コード例 #1
0
        public void Creates_listcommands_command_when_null_arguments_passed(ICommandFactory commandFactory,
                                                                            ICraneCommand craneCommand)
        {
            "Given I have a command factory"
            ._(() => commandFactory = ServiceLocator.Resolve <ICommandFactory>());

            "When I create a command with no arguments"
            ._(() => craneCommand = commandFactory.Create(null));

            "Then the command returned should be the list commands command"
            ._(() => craneCommand.Should().BeOfType <ListCommands>());
        }
コード例 #2
0
        public void Creates_command_when_arguments_passed_by_switches(ICommandFactory commandFactory,
                                                                      ICraneCommand craneCommand)
        {
            "Given I have a command factory"
            ._(() => commandFactory = ServiceLocator.Resolve <ICommandFactory>());

            "When I create a command with based on the arguments 'init testproject"
            ._(() => craneCommand = commandFactory.Create("init", "-projectName", "testproject"));

            "Then the command returned should be the init command"
            ._(() => craneCommand.Should().BeOfType <Init>());

            "And the ProjectName should be testproject"
            ._(() => ((Init)craneCommand).ProjectName.Should().Be("testproject"));
        }