Esempio n. 1
0
        public void SearchManagerFactory_ThrowsExceptionOnIncorrectType()
        {
            // Arrange
            var searchManagerFactory = new SearchManagerFactory();

            // Act and Assert
            Assert.Throws <NotImplementedException>(() => searchManagerFactory.GetSearchManager(SearchManagerType.Invalid));
        }
Esempio n. 2
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;
            }
        }