public void RunSingleCommand() { var menu = new CommandMenu(); var document = new Document("great expectations"); menu.AddCommand(TitleCaseMenuText, new TitleCaseCommand(document)); menu.Run(TitleCaseMenuText); Assert.That(document.Text, Is.EqualTo("Great Expectations")); }
public void RunTwoDifferentCommands() { var menu = new CommandMenu(); var document = new Document("great expectations"); menu.AddCommand(TitleCaseMenuText, new TitleCaseCommand(document)); menu.AddCommand(ToUpperCaseMenuText, new UpperCaseCommand(document)); menu.Run(TitleCaseMenuText); menu.Run(ToUpperCaseMenuText); Assert.That(document.Text, Is.EqualTo("GREAT EXPECTATIONS")); }