public void DisplayAnEmptyScoreSheetToConsole() { // Arrange var _scoreSheetMock = new Mock<IScoreSheet>(); var expectedScoreSheetDisplayOutput = Resources.EmptyScoreSheetConsoleOutput; string actualScoreSheetDisplayOutput; // Act using(StringWriter stringWriter = new StringWriter()) { Console.SetOut(stringWriter); _scoreSheetDisplayer = new ScoreSheetConsoleDisplayer(); _scoreSheetDisplayer.Display(_scoreSheetMock.Object); actualScoreSheetDisplayOutput = stringWriter.ToString(); } // Assert expectedScoreSheetDisplayOutput.Should().Be(actualScoreSheetDisplayOutput); }
public void ScoreSheetConsoleDisplayer_ScoreSheetIsEmpty_WriteEmptyScoreSheetToStandardOut() { // Arrange _scoreSheetMock = new Mock<IScoreSheet>(); var expectedScoreSheetDisplayOutput = Resources.EmptyScoreSheetConsoleOutput; string actualScoreSheetDisplayOutput; // Act using (StringWriter stringWriter = new StringWriter()) { Console.SetOut(stringWriter); _scoreSheetDisplayer = new ScoreSheetConsoleDisplayer(); _scoreSheetDisplayer.Display(_scoreSheetMock.Object); actualScoreSheetDisplayOutput = stringWriter.ToString(); } // Assert expectedScoreSheetDisplayOutput.Should().Be(actualScoreSheetDisplayOutput); }
public void ScoreSheetConsoleDisplayer_ScoreSheetIsComplete_WriteCompletedScoreSheetToStandardOut() { // Arrange _scoreSheetMock = new Mock<IScoreSheet>(); SetUpCompleteScoreSheet(); var expectedScoreSheetDisplayOutput = Resources.CompletedScoreSheetConsoleOutput; string actualScoreSheetDisplayOutput; // Act using (StringWriter stringWriter = new StringWriter()) { Console.SetOut(stringWriter); _scoreSheetDisplayer = new ScoreSheetConsoleDisplayer(); _scoreSheetDisplayer.Display(_scoreSheetMock.Object); actualScoreSheetDisplayOutput = stringWriter.ToString(); } // Assert expectedScoreSheetDisplayOutput.Should().Be(actualScoreSheetDisplayOutput); }