public async Task ExecuteReturnsResultsForSpecificQuery()
 {
     var query = new AutocompleteServicePackageVersionsQuery(GetConfiguration());
     var result = await query.Execute("newtonsoft.json", false);
     Assert.NotEmpty(result);
     Assert.True(result.Any());
 }
Esempio n. 2
0
        public async Task ExecuteReturnsResultsForSpecificQuery()
        {
            var query  = new AutocompleteServicePackageVersionsQuery(GetConfiguration(), GetResilientSearchClient());
            var result = await query.Execute("newtonsoft.json", false);

            Assert.True(result.Any());
        }
        public async Task ExecuteThrowsForEmptyId()
        {
            var query = new AutocompleteServicePackageVersionsQuery(GetConfiguration(), GetResilientSearchClient());
            await Assert.ThrowsAsync <ArgumentNullException>(async() => await query.Execute(string.Empty, false));

            Assert.Empty(_testHandler.Requests);
        }
        public async Task ExecuteReturnsResultsForSpecificQuery()
        {
            var query  = new AutocompleteServicePackageVersionsQuery(GetConfiguration(), GetResilientSearchClient());
            var result = await query.Execute("newtonsoft.json", false);

            Assert.True(result.Any());
            var request = Assert.Single(_testHandler.Requests);

            Assert.Equal("https://example/autocomplete?id=newtonsoft.json&prerelease=False", request.RequestUri.AbsoluteUri);
        }
 public async Task ExecuteThrowsForEmptyId()
 {
     var query = new AutocompleteServicePackageVersionsQuery(GetConfiguration());
     await Assert.ThrowsAsync<ArgumentNullException>(async () => await query.Execute("", false));
 }
Esempio n. 6
0
 public async Task ExecuteThrowsForEmptyId()
 {
     var query = new AutocompleteServicePackageVersionsQuery(GetConfiguration());
     await Assert.ThrowsAsync <ArgumentNullException>(async() => await query.Execute("", false));
 }