public void should_display_menu()
        {
            _inputOutputStub.AddKeys(ConsoleKey.Enter);

            _launcher.Run();

            const string expectedOutput = @"<CLEAR>
Select mode:
1) Display negative words count
2) Filter negative words
3) Display original text
Any other - exit
<READ KEY>
Enter
";

            Assert.That(_inputOutputStub.GetOutput(), Is.EqualTo(expectedOutput));
        }
예제 #2
0
        public void for_user_should_do_correct_output()
        {
            //given
            const string  content       = "The weather in Manchester in winter is bad. It rains all the time - it must be horrible for people visiting.";
            var           negativeWords = new[] { "bad", "horrible" };
            const Command command       = Command.DisplayNegativeCount;

            const string expectedOutput = @"Scanned the text:
The weather in Manchester in winter is bad. It rains all the time - it must be horrible for people visiting.
Total Number of negative words: 2
Press ANY key to exit.
<READ KEY>
Enter
";

            //when
            _commandProcessor.Run(command, content, negativeWords);

            //then
            var output = _inputOutput.GetOutput();

            Assert.That(output, Is.EqualTo(expectedOutput));
        }