Beispiel #1
0
        public void ShouldValidateTheVariables()
        {
            //Arrange
            ClassVariableTypeValidation classVariableTypeValidation = new ClassVariableTypeValidation()
                                                                      .Add <ConsoleReaderBookEnd>("_reader");

            //Act
            ConsoleGameEnding subject = new ConsoleGameEnding();

            //Assert
            classVariableTypeValidation.AssertExpectedVariables(subject);
        }
Beispiel #2
0
        public void ShouldPrintOutGameOverAndWaitForInput()
        {
            //Arrange
            FakeWriter        fakeWriter = new FakeWriter();
            FakeReader        fakeReader = new FakeReader(Environment.NewLine);
            ConsoleGameEnding subject    = new ConsoleGameEnding(fakeReader, fakeWriter);

            //Act
            subject.Display();

            //Assert
            fakeWriter.AssertLinesWritten("Game over", "Press Enter to Exit");
            fakeReader.AssertReadLineInvoked();
        }