public async Task EnsureGetArtistSearchSuggestionsReturnsValuesForValidSearch()
 {
     IMusicClient client = new MusicClient("test", "gb", new MockApiRequestHandler(Resources.search_suggestions));
     ListResponse<string> result = await client.GetArtistSearchSuggestionsAsync("green");
     Assert.IsNotNull(result, "Expected a result");
     Assert.IsNotNull(result.StatusCode, "Expected a status code");
     Assert.IsTrue(result.StatusCode.HasValue, "Expected a status code");
     Assert.AreEqual(HttpStatusCode.OK, result.StatusCode.Value, "Expected a 200 response");
     Assert.IsNotNull(result.Result, "Expected a list of results");
     Assert.IsNull(result.Error, "Expected no error");
     Assert.Greater(result.Result.Count, 0, "Expected more than 0 results");
 }
Ejemplo n.º 2
0
        public async Task EnsureGetArtistSearchSuggestionsReturnsValuesForValidSearch()
        {
            IMusicClient          client = new MusicClient("test", "gb", new MockApiRequestHandler(Resources.search_suggestions));
            ListResponse <string> result = await client.GetArtistSearchSuggestionsAsync("green");

            Assert.IsNotNull(result, "Expected a result");
            Assert.IsNotNull(result.StatusCode, "Expected a status code");
            Assert.IsTrue(result.StatusCode.HasValue, "Expected a status code");
            Assert.AreEqual(HttpStatusCode.OK, result.StatusCode.Value, "Expected a 200 response");
            Assert.IsNotNull(result.Result, "Expected a list of results");
            Assert.IsNull(result.Error, "Expected no error");
            Assert.Greater(result.Result.Count, 0, "Expected more than 0 results");
        }
 public async void EnsureAsyncGetArtistSearchSuggestionsReturnsItems()
 {
     // Only test happy path, as the MusicClient tests cover the unhappy path
     IMusicClient client = new MusicClient("test", "gb", new MockApiRequestHandler(Resources.search_suggestions));
     ListResponse<string> result = await client.GetArtistSearchSuggestionsAsync("test");
     Assert.Greater(result.Result.Count, 0, "Expected more than 0 results");
 }