// Test Strings public void FormatAsBold_WhenCalled_ShouldEncloseTheStringWithStrongElement() { var formatter = new HTMLFormatter(); var result = formatter.FormatAsBold("abc"); // Too Specific Assert.Equal("<strong>abc</strong>", result.ToLower()); //More general Assert.StartsWith("<strong>", result.ToLower()); Assert.EndsWith("</strong>", result.ToLower()); Assert.Contains("abc", result.ToLower()); }
public void FormatAsBold_WhenCalled_ShouldReturnStringWithStrongElement() { var htmlFormat = new HTMLFormatter(); var result = htmlFormat.FormatAsBold("abc"); //Specific assertion Assert.That(result, Is.EqualTo("<strong>abc</strong>")); //More general assertion Assert.That(result, Does.StartWith("<strong>")); //Better Assert.That(result, Does.Contain("abc")); }