Exemple #1
0
        public void ListenForCommands_UserInputsEmptyString_CommandListeningFinished()
        {
            List <string> ReadLine_Returns = new List <string>
            {
                ""
            };
            IUserInput_Stub userInput_stub             = new IUserInput_Stub(ReadLine_Returns);
            IOutputStringCalculator_Mock calcuator     = new IOutputStringCalculator_Mock(new List <int>());
            ConsoleCommandReader         commandReader = new ConsoleCommandReader(calcuator, userInput_stub);

            StartCheckingConsoleOutput();

            commandReader.ListenForCommands();

            CheckInheritedAsserts("");
        }
Exemple #2
0
        public void ListenForCommands_InputOfValidSimpleUsersCommands_CommandsExecuted()
        {
            IOutputStringCalculator_Mock calculator = new IOutputStringCalculator_Mock(10);

            List <string> ReadLine_Returns = new List <string>
            {
                "calc '1,3,5,1'",
                ""
            };
            IUserInput_Stub      userInput_stub = new IUserInput_Stub(ReadLine_Returns);
            ConsoleCommandReader commandReader  = new ConsoleCommandReader(calculator, userInput_stub);

            StartCheckingConsoleOutput();

            commandReader.ListenForCommands();

            CheckInheritedAsserts("The result is 10" + Environment.NewLine + "Another input please" + Environment.NewLine);
        }