public ShowHelpOverview ( IEnumerable |
||
commands | IEnumerable |
|
return | void |
public void ShowHelpOverview_ApplicationName_IsWrittenToTheUserInterface() { // Arrange var commands = new List<ICommand>(); var applicationInformation = new ApplicationInformation { ApplicationName = "App Name" }; var helpProvider = new HelpProvider(applicationInformation, this.loggingUserInterface.UserInterface); // Act helpProvider.ShowHelpOverview(commands); // Assert Assert.IsTrue(this.loggingUserInterface.UserInterfaceOutput.Contains(applicationInformation.ApplicationName)); }
public void ShowHelpOverview_CommandsParameterIsNull_ArgumentNullExceptionIsThrown() { // Arrange List<ICommand> commands = null; var applicationInformation = new ApplicationInformation(); var userInterface = new Mock<IUserInterface>(); var helpProvider = new HelpProvider(applicationInformation, userInterface.Object); // Act helpProvider.ShowHelpOverview(commands); }
public void ShowHelpOverview_CommandNameOfEachAvailableCommand_IsWrittenToTheUserInterface() { // Arrange var commands = new List<ICommand> { CommandTestUtilities.GetCommand("test"), CommandTestUtilities.GetCommand("update"), CommandTestUtilities.GetCommand("delete") }; var applicationInformation = new ApplicationInformation { NameOfExecutable = "AppName.exe" }; var helpProvider = new HelpProvider(applicationInformation, this.loggingUserInterface.UserInterface); // Act helpProvider.ShowHelpOverview(commands); // Assert foreach (var command in commands) { Assert.IsTrue(this.loggingUserInterface.UserInterfaceOutput.Contains(command.Attributes.CommandName)); } }