Пример #1
0
        public Program(ApplicationInformation applicationInformation, IUserInterface userInterface, IActionLogger logger, ICommandLineArgumentInterpreter commandLineArgumentInterpreter, IHelpCommand helpCommand)
        {
            if (applicationInformation == null)
            {
                throw new ArgumentNullException("applicationInformation");
            }

            if (userInterface == null)
            {
                throw new ArgumentNullException("userInterface");
            }

            if (logger == null)
            {
                throw new ArgumentNullException("logger");
            }

            if (commandLineArgumentInterpreter == null)
            {
                throw new ArgumentNullException("commandLineArgumentInterpreter");
            }

            if (helpCommand == null)
            {
                throw new ArgumentNullException("helpCommand");
            }

            this.applicationInformation = applicationInformation;
            this.userInterface = userInterface;
            this.logger = logger;
            this.commandLineArgumentInterpreter = commandLineArgumentInterpreter;
            this.helpCommand = helpCommand;
        }
Пример #2
0
        public void BeforeEachTest()
        {
            this.sequentialTestExecutionMonitor.WaitOne();

            CommandLineIntegrationTestUtilities.RemoveAllFilesAndFoldersWhichAreCreatedOnStartup();

            StructureMapSetup.Setup();
            this.encodingProvider = ObjectFactory.GetInstance<IEncodingProvider>();
            this.applicationInformation = ObjectFactory.GetInstance<ApplicationInformation>();
            this.commandProvider = ObjectFactory.GetInstance<ICommandProvider>();
            this.userInterface = ObjectFactory.GetInstance<IUserInterface>();
            this.logger = ObjectFactory.GetInstance<IActionLogger>();
            this.commandLineArgumentInterpreter = ObjectFactory.GetInstance<ICommandLineArgumentInterpreter>();
            this.helpCommand = ObjectFactory.GetInstance<IHelpCommand>();

            this.program = new Program(this.applicationInformation, this.userInterface, this.logger, this.commandLineArgumentInterpreter, this.helpCommand);
        }
        public void Setup()
        {
            var userInterfaceMock = new Mock<IUserInterface>();
            var solutionPackagingServiceMock = new Mock<ISolutionPackagingService>();
            var buildPropertyParser = new Mock<IBuildPropertyParser>();
            var publishingService = new Mock<IPublishingService>();

            this.packackageSolutionCommand = new PackageSolutionCommand(userInterfaceMock.Object, solutionPackagingServiceMock.Object, buildPropertyParser.Object, publishingService.Object);

            this.commands = new List<ICommand> { this.packackageSolutionCommand };

            this.commandProvider = new ConsoleCommandProvider(this.commands);
            this.commandNameMatcher = new CommandNameMatcher();
            this.commandArgumentParser = new CommandArgumentParser();
            this.commandArgumentNameMatcher = new CommandArgumentNameMatcher();

            this.commandLineArgumentInterpreter = new CommandLineArgumentInterpreter(
                this.commandProvider, this.commandNameMatcher, this.commandArgumentParser, this.commandArgumentNameMatcher);
        }