GildedRose-Refactoring-Kata/TestNinja/TestNinja.UnitTests/UnitTests/HtmlFormatterTests.cs
2018-11-11 18:50:47 +01:00

33 lines
853 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NUnit.Framework;
using NUnit.Framework.Internal;
using TestNinja.Fundamentals;
namespace TestNinja.UnitTests.UnitTests
{
[TestFixture]
class HtmlFormatterTests
{
[Test]
public void FormatAsBold_WhenCalled_ShouldEncloseTheStringWithStrongElement()
{
var formatter = new HtmlFormatter();
var result = formatter.FormatAsBold("abc");
//specific assertion
Assert.That(result, Is.EqualTo("<strong>abc</strong>").IgnoreCase);
//more general
Assert.That(result, Does.StartWith("<strong>"));
Assert.That(result, Does.EndWith("</strong>"));
Assert.That(result, Does.Contain("abc"));
}
}
}