示例#1
0
        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"));
        }
示例#2
0
        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"));
        }
        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"));
        }
        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"));
        }