예제 #1
0
        public void Can_get_images_from_html()
        {
            // arrange
            var html = "<img src='http://test.com/image1.jpg' />" +
                       "<img src=\"http://test.com/image2.jpg\" />" +
                       "<img src=\"\" />";

            // act
            var result = _mediaScrapper.GetImagesFromHtml(html);

            // assert
            result.Count.Should().Be(2);
            result[0].Should().Be("http://test.com/image1.jpg");
            result[1].Should().Be("http://test.com/image2.jpg");
        }
예제 #2
0
        public void Can_get_images_from_html()
        {
            // arrange
            var html = "<img src='http://test.com/image1.jpg' />" +
                       "<img src=\"http://test.com/image2.jpg\" />" +
                       "<img src=\"\" />";

            // act
            var result = _mediaScrapper.GetImagesFromHtml(html);

            // assert
            Assert.That(result.Count, Is.EqualTo(2));
            Assert.That(result[0], Is.EqualTo("http://test.com/image1.jpg"));
            Assert.That(result[1], Is.EqualTo("http://test.com/image2.jpg"));
        }