コード例 #1
0
        public void GetHtmlDomSearchXPath_ShouldReturnFollowingXPath()
        {
            var expectedXPath = "//div[@id='search']//div[@class='g']//div[@class='r']/a";

            var sut = new GoogleSearchStrategy();

            Assert.Equal(expectedXPath, sut.GetHtmlDomSearchXPath());
        }
コード例 #2
0
        public void GetSearchPageUrl_ShouldContainGoogleInUrl()
        {
            var expectedTerm = "Google";

            var sut = new GoogleSearchStrategy();

            Assert.Contains(expectedTerm, sut.GetSearchPageUrl(1));
        }
コード例 #3
0
        public void GetSearchPageUrl_ShouldReturnNull_IfPageNoIsLessThan1()
        {
            var sut = new GoogleSearchStrategy();

            Assert.Null(sut.GetSearchPageUrl(0));
        }
コード例 #4
0
        public void GetSearchPageUrl_ShouldReturnNull_IfPageNoIsHigherThan10()
        {
            var sut = new GoogleSearchStrategy();

            Assert.Null(sut.GetSearchPageUrl(11));
        }