Beispiel #1
0
        public async Task ExecuteReturnsResultsForSpecificQuery()
        {
            var query  = new AutoCompleteServicePackageVersionsQuery(GetConfiguration());
            var result = await query.Execute("newtonsoft.json", false);

            Assert.True(result.Any());
        }
Beispiel #2
0
        public void PackageVersionsQueryBuildsCorrectQueryString(bool includePrerelease, string semVerLevel, string expectedQueryString)
        {
            // Arrange
            var query = new AutoCompleteServicePackageVersionsQuery(GetConfiguration());

            // Act
            var actualQueryString = query.BuildQueryString("id=Newtonsoft.Json", includePrerelease, semVerLevel);

            // Assert
            Assert.Equal(expectedQueryString, actualQueryString);
        }
Beispiel #3
0
 public async Task ExecuteThrowsForEmptyId()
 {
     var query = new AutoCompleteServicePackageVersionsQuery(GetConfiguration());
     await Assert.ThrowsAsync <ArgumentNullException>(async() => await query.Execute("", false));
 }