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);
        }
Beispiel #2
0
        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);
            }
        }
Beispiel #3
0
        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);
            }
        }
 public void TestGetHtmlElementShouldReturnBoldenedElement()
 {
     Assert.That(_boldenHtmlElement.GetHtmlElement(), Is.EqualTo("<b>Google</b>"));
     _htmlElement.Verify(htmlElement => htmlElement.GetHtmlElement(), Times.Once);
 }