public void Constructor_CommandLineArgumentInterpreterParameterIsNotSet_ArgumentNullExceptionIsThrown() { // Arrange var applicationInformation = new ApplicationInformation(); var userInterface = new Mock<IUserInterface>(); var logger = new Mock<IActionLogger>(); var helpCommand = new HelpCommand(new Mock<IHelpProvider>().Object); // Act new Program(applicationInformation, userInterface.Object, logger.Object, null, helpCommand); }
public void Constructor_CommandAttributesAreInitializedProperly() { // Arrange var helpProvider = new Mock<IHelpProvider>(); // Act var helpCommand = new HelpCommand(helpProvider.Object); // Assert CommandTestUtilities.ValidateCommandAttributes(helpCommand.Attributes); }
public void Constructor_AllParametersAreSet_ObjectIsInstantiated() { // Arrange var helpProvider = new Mock<IHelpProvider>(); // Act var helpCommand = new HelpCommand(helpProvider.Object); // Assert Assert.IsNotNull(helpCommand); }
public void Execute_NoCommandNameArgumentSupplied_GeneralHelpIsCalled() { // Arrange var helpProvider = new Mock<IHelpProvider>(); var helpCommand = new HelpCommand(helpProvider.Object); // Act helpCommand.Execute(); // Assert helpProvider.Verify(h => h.ShowHelpOverview(It.IsAny<IEnumerable<ICommand>>()), Times.Once()); }
public void Setup() { this.userInterface = new Mock<IUserInterface>().Object; this.installationStatus = new InstallationStatusCommand(this.userInterface, new Mock<IInstallationStatusProvider>().Object); this.install = new InstallCommand(this.userInterface, new Mock<IPackageInstaller>().Object, new Mock<IDeploymentTypeParser>().Object); this.uninstall = new UninstallCommand(this.userInterface, new Mock<IPackageUninstaller>().Object); this.cleanup = new CleanupCommand(this.userInterface, new Mock<ICleanupService>().Object); this.packageSolution = new PackageSolutionCommand(this.userInterface, new Mock<ISolutionPackagingService>().Object, new Mock<IBuildPropertyParser>().Object, new Mock<IPublishingService>().Object); this.packageBuildOutput = new PackageBuildOutputCommand(this.userInterface, new Mock<IBuildOutputPackagingService>().Object, new Mock<IPublishingService>().Object); this.configureSources = new RepositorySourceConfigurationCommand(this.userInterface, new Mock<IRepositoryConfigurationCommandActionParser>().Object, new Mock<ISourceRepositoryProvider>().Object); this.configurePublishingTargets = new PublishingTargetConfigurationCommand(this.userInterface, new Mock<IPublishingTargetConfigurationCommandActionParser>().Object, new Mock<IPublishConfigurationAccessor>().Object); this.selfUpdate = new SelfUpdateCommand(new ApplicationInformation(), new Mock<ISelfUpdateService>().Object, new Mock<_Assembly>().Object); this.publishCommand = new PublishCommand(this.userInterface, new Mock<IPublishingService>().Object); this.help = new HelpCommand(new Mock<IHelpProvider>().Object); }