public void TestGetHtmlElementShouldReturnHyperLinkifiedAndBoldenedElement() { var boldenHtmlElement = new BoldenHtmlElement(_hyperLinkifyHtmlElement); Assert.That(boldenHtmlElement.GetHtmlElement(), Is.EqualTo("<b><a href=\"www.google.com\">Google</a></b>")); _htmlElement.Verify(htmlElement => htmlElement.GetHtmlElement(), Times.Once); }
public void Setup() { _htmlElement = new Mock <IHtmlElement>(); _boldenHtmlElement = new BoldenHtmlElement(_htmlElement.Object); _italicizeHtmlElement = new ItalicizeHtmlElement(_htmlElement.Object); _hyperLinkifyHtmlElement = new HyperLinkifyHtmlElement("www.google.com", _htmlElement.Object); _htmlElement.Setup(htmlElement => htmlElement.GetHtmlElement()).Returns("Google"); }
public void BoldenHtmlElement_WhenUsingBoldenDecorator() { // Arrange var bolden = new BoldenHtmlElement(_htmlElement); // Act var result = bolden.GetHtmlElement(); // Assert using (new FluentAssertions.Execution.AssertionScope("boldened html element")) { result.Should().Be($"<b>{_DummyElement}</b>"); Mock.Get(_htmlElement).Verify(htmlElement => htmlElement.GetHtmlElement(), Times.Once); } }
public void HyperlinkAndBoldenHtmlElement_WhenUsingBoldenHyperlinkifyDecorator() { // Arrange var hyperlinked = new HyperLinkifyHtmlElement(_DummyLink, _htmlElement); var boldenedHyperlinked = new BoldenHtmlElement(hyperlinked); // Act var result = boldenedHyperlinked.GetHtmlElement(); // Assert using (new FluentAssertions.Execution.AssertionScope("hyperlinked and boldened html element")) { result.Should().Be($"<b><a href=\"{_DummyLink}\">{_DummyElement}</a></b>"); Mock.Get(_htmlElement).Verify(htmlElement => htmlElement.GetHtmlElement(), Times.Once); } }