public void ShowHelp_Examples_AreWrittenToTheUserInterface() { // Arrange ICommand command = CommandTestUtilities.GetCommand("SomeCommand"); var applicationInformation = new ApplicationInformation(); var helpProvider = new HelpProvider(applicationInformation, this.loggingUserInterface.UserInterface); // Act helpProvider.ShowHelp(command); // Assert foreach (var example in command.Attributes.Examples) { Assert.IsTrue(this.loggingUserInterface.UserInterfaceOutput.Contains(example.Key)); Assert.IsTrue(this.loggingUserInterface.UserInterfaceOutput.Contains(example.Value)); } }
public void ShowHelp_SuppliedCommandIsNull_ArgumentNullExceptionIsThrown() { // Arrange ICommand command = null; var applicationInformation = new ApplicationInformation(); var userInterface = new Mock<IUserInterface>(); var helpProvider = new HelpProvider(applicationInformation, userInterface.Object); // Act helpProvider.ShowHelp(command); }
public void ShowHelp_CommandName_IsWrittenToTheUserInterface() { // Arrange ICommand command = CommandTestUtilities.GetCommand("SomeCommand"); var applicationInformation = new ApplicationInformation(); var helpProvider = new HelpProvider(applicationInformation, this.loggingUserInterface.UserInterface); // Act helpProvider.ShowHelp(command); // Assert Assert.IsTrue(this.loggingUserInterface.UserInterfaceOutput.Contains(command.Attributes.CommandName)); }