예제 #1
0
        public void ParseSearchResultForRanks_MultipleRanksFound_ReturnsCorrectly()
        {
            // Arrange
            var searchResult = TestHelper.GetTextFromFile("GoogleSearchResultForConveyancingSoftware.txt");
            var url          = "globalx.com.au";
            var service      = new GoogleParser();

            // Act
            var result = service.ParseSearchResultForRanks(searchResult, url);

            // Assert
            Assert.AreEqual("6, 7", result);
        }
예제 #2
0
        public void ParseSearchResultForRanks_EmptyResult_Returns0()
        {
            // Arrange
            var searchResult = "";
            var url          = "www.smokeball.com.au";
            var service      = new GoogleParser();

            // Act
            var result = service.ParseSearchResultForRanks(searchResult, url);

            // Assert
            Assert.AreEqual("0", result);
        }
예제 #3
0
        public void ParseSearchResultForRanks_NoRanksFound_Returns0()
        {
            // Arrange
            var searchResult = TestHelper.GetTextFromFile("GoogleSearchResultForConveyancingSoftware.txt");
            var url          = "www.yahoo.com";
            var service      = new GoogleParser();

            // Act
            var result = service.ParseSearchResultForRanks(searchResult, url);

            // Assert
            Assert.AreEqual("0", result);
        }