public void IgnoreAnchorTags(string content)
        {
            // Arrange
            var uri = new Uri("http://google.com/");

            // Act
            var examiner = new AngleSharpExaminer(new Mock<ILog>().Object, uri, content);

            // Assert
            Assert.Empty(examiner.Links);
        }
        public void OnlyReturnSameUriOnce()
        {
            // Arrange
            var uri = new Uri("http://google.com/");
            var content = "<a href='Http://www.google.com/'></a><a href='Http://www.google.com/'></a>";

            // Act
            var examiner = new AngleSharpExaminer(new Mock<ILog>().Object, uri, content);

            // Assert
            Assert.Single(examiner.Links);
        }
        public void LogWhenHrefIsEmptyOrWhitespace(string content)
        {
            // Arrange
            var log = new Mock<ILog>();
            var uri = new Uri("http://google.com/");

            // Act
            var examiner = new AngleSharpExaminer(log.Object, uri, content);

            // Assert
            log.Verify(x => x.Log(It.Is<LogMessage>( l => l.LogType == LogType.Error && l.Uri == uri)), Times.Once);
        }
        public void ReturnValidAbsoluteUrls(string content)
        {
            // Arrange
            var uri = new Uri("http://google.com/");

            // Act
            var examiner = new AngleSharpExaminer(new Mock<ILog>().Object, uri, content);

            // Assert
            Assert.Single(examiner.Links);
        }
        public void PrefixRelativeAndAbsoluteUrisWithHost(string content)
        {
            // Arrange
            var uri = new Uri("http://google.com/");

            // Act
            var examiner = new AngleSharpExaminer(new Mock<ILog>().Object, uri, content);

            // Assert
            Assert.Single(examiner.Links);
            Assert.Equal(uri.Host, examiner.Links.First().Host);
        }