public async Task SearchAsync_MustReturnSearchResult() { var provider = new ValueServiceProvider { ServiceMap = new Dictionary <Type, Func <object> > { } }; var provfc = new ValueServiceScopeFactory { ScopeFactory = () => new ValueServiceScope { ServiceProvider = provider } }; var eng = new SearchEngine(provfc); provider.ServiceMap[typeof(SearchEngine)] = () => eng; provider.ServiceMap [typeof(IServiceScopeFactory)] = () => provfc; var res = await ComicHostExtensions.SearchAsync(provider, null, 5, 10); Assert.IsNotNull(res); }
public async Task GivenNullValue_CallSearchAsync_MustThrowException() { await Assert.ThrowsExceptionAsync <ArgumentNullException>(() => ComicHostExtensions.SearchAsync(null, null, 0, 0)); }