public void ToString_BlockIsVisible_ReturnEmptyString() { // Arrange var scoreHtml = new StringBuilder(); var block = new Choice_Score_Block(); block.Visible = false; // Act block.ToString(ref scoreHtml); // Assert Assert.IsNullOrEmpty(scoreHtml.ToString()); }
public void ToString_WhenCalled_ReturnHtmlString() { // Arrange var homeScore = "1"; var awayScore = "2"; var scoreHtml = new StringBuilder(); var block = new Choice_Score_Block(); block.homeScore = homeScore; block.awayScore = awayScore; // Act block.ToString(ref scoreHtml); // Assert var expectedHtml = string.Format(ScoreTemplate, homeScore, awayScore); Assert.AreEqual(expectedHtml, scoreHtml.ToString()); }