public async Task Search_AcceptsCorrectRoutes(SearchManagerType searchEngine)
        {
            //Arrange
            var keywords         = "term1 term2";
            var url              = "www.example.com";
            var searchController = getSUT();

            //Act
            var result = await searchController.Get(searchEngine.ToString(), keywords, url, 100);
        }
Esempio n. 2
0
        public ISearchManager GetSearchManager(SearchManagerType searchManagerType)
        {
            switch (searchManagerType)
            {
            case SearchManagerType.Google:
                return(new GoogleSearchManager());

            case SearchManagerType.Bing:
                return(new BingSearchManager());

            default:
                throw new NotImplementedException($"{searchManagerType} is not currently supported");
            }
        }
Esempio n. 3
0
        public void SearchManagerFactory_ReturnsCorrectService(SearchManagerType searchManagerType)
        {
            // Arrange
            var searchManagerFactory = new SearchManagerFactory();

            // Act
            var result = searchManagerFactory.GetSearchManager(searchManagerType);

            // Assert
            switch (searchManagerType)
            {
            case SearchManagerType.Google:
                Assert.IsType <GoogleSearchManager>(result);
                break;

            case SearchManagerType.Bing:
                Assert.IsType <BingSearchManager>(result);
                break;
            }
        }