public void Test_CreateSearchComponent_Positive() { ISearchComponentFactory serviceFactory = new SearchComponentFactory(); ISearchComponent SearchComponent = serviceFactory.CreateSearchComponent(DataSources.Flicker); Assert.IsTrue(SearchComponent is FlickerSearchSearchComponent); ISearchComponent SearchComponent2 = serviceFactory.CreateSearchComponent(DataSources.Flicker); Assert.IsTrue(SearchComponent2 is FlickerSearchSearchComponent); Assert.AreSame(SearchComponent, SearchComponent2); ISearchComponent SearchComponent3 = serviceFactory.CreateSearchComponent(DataSources.Flicker); Assert.IsTrue(SearchComponent3 is FlickerSearchSearchComponent); Assert.AreSame(SearchComponent, SearchComponent3); ISearchComponent SearchComponent4 = serviceFactory.CreateSearchComponent(DataSources.NewsAPI); Assert.IsTrue(SearchComponent4 is NewsAPISearchhComponent); ISearchComponent SearchComponent5 = serviceFactory.CreateSearchComponent(DataSources.NewsAPI); Assert.IsTrue(SearchComponent5 is NewsAPISearchhComponent); Assert.AreSame(SearchComponent5, SearchComponent4); ISearchComponentFactory serviceFactory6 = new SearchComponentFactory(); ISearchComponent SearchComponent6 = serviceFactory.CreateSearchComponent(DataSources.Flicker); Assert.IsTrue(SearchComponent6 is FlickerSearchSearchComponent); Assert.AreSame(SearchComponent, SearchComponent6); }
public async Task Test_FlickerSearchComponent_Exception_Negative() { ISearchComponentFactory serviceFactory = new SearchComponentFactory(); ISearchComponent SearchComponent = serviceFactory.CreateSearchComponent(DataSources.Flicker); IQueryContext queryContext = new QueryContext(); queryContext.ApplicationConfiguration = null; queryContext.QueryParam = null; IResponseContext rc = await SearchComponent.PerformSearch(queryContext); }