public void ToString_BlockIsVisible_ReturnEmptyString() { // Arrange var handicapHtml = new StringBuilder(); var block = new Choice_Handicap_Block(); block.Visible = false; // Act block.ToString(ref handicapHtml); // Assert Assert.IsNullOrEmpty(handicapHtml.ToString()); }
public void ToString_BlockOddsIsNull_ReturnHtmlStringWithOddsBlockIsEmpty() { // Arrange var handicap = "1-2"; var handicapHtml = new StringBuilder(); var block = new Choice_Handicap_Block(); block.handicap = handicap; block.Odds = null; // Act block.ToString(ref handicapHtml); // Assert var expectedHtml = string.Format(HandicapTemplate, handicap, string.Empty); Assert.AreEqual(expectedHtml, handicapHtml.ToString()); }
public void ToString_WhenCalled_ReturnHtmlString() { // Arrange var handicap = "1-2"; var odds = "1"; var handicapHtml = new StringBuilder(); var block = new Choice_Handicap_Block(); block.handicap = handicap; block.Odds.odds = odds; // Act block.ToString(ref handicapHtml); // Assert var expectedHtml = string.Format(HandicapTemplate, handicap, block.Odds.ToString()); Assert.AreEqual(expectedHtml, handicapHtml.ToString()); }