Ejemplo n.º 1
0
        public async Task Search_Success_WithEmptyResults()
        {
            var bingSearchEngine = new BingSearchEngine(
                GetOptions("accessKey"),
                GetMockWebDataSearchWithEmptyResults());
            var result = await bingSearchEngine.SearchFirst10("query");

            Assert.Empty(result);
        }
Ejemplo n.º 2
0
        public async Task Search_Success_With10Results()
        {
            var bingSearchEngine = new BingSearchEngine(
                GetOptions("accessKey"),
                GetMockWebDataSearchWith10Results());
            var result = await bingSearchEngine.SearchFirst10("query");

            Assert.Equal(FoundItemVMTestUtilities.GetTestFoundItems(count),
                         result, new FoundItemVMComparer());
        }
Ejemplo n.º 3
0
        public async Task Search_ArgumentNullException_AccessKey(string accessKey)
        {
            var bingSearchEngine = new BingSearchEngine(
                GetOptions(accessKey),
                GetMockWebDataSearchWith10Results());
            var ex = await Assert.ThrowsAsync <ArgumentNullException>(() =>
                                                                      bingSearchEngine.SearchFirst10("query"));

            Assert.Equal(nameof(accessKey), ex.ParamName);
        }