public async Task EnsureGetTopProductsForGenreReturnsItems()
        {
            IMusicClient client = new MusicClient("test", "gb", new MockApiRequestHandler(Resources.product_parse_tests));

            this.ValidateTopProductsResponse(await client.GetTopProductsForGenreAsync(new Genre()
            {
                Id = "rock"
            }, Category.Album));
            this.ValidateTopProductsResponse(await client.GetTopProductsForGenreAsync("rock", Category.Album));
        }
        public void EnsureGetTopProductsForGenreThrowsExceptionForNullGenreId()
        {
            IMusicClient client      = new MusicClient("test", "gb", new MockApiRequestHandler(Resources.product_parse_tests));
            string       nullGenreId = null;

            client.GetTopProductsForGenreAsync(nullGenreId, Category.Album).Wait();
        }
Example #3
0
 public async Task EnsureGetTopProductsForGenreReturnsItems()
 {
     IMusicClient client = new MusicClient("test", "gb", new MockApiRequestHandler(Resources.product_parse_tests));
     this.ValidateTopProductsResponse(await client.GetTopProductsForGenreAsync("rock", Category.Album));
 }
Example #4
0
 public async Task EnsureGetTopProductsForGenreThrowsExceptionForNullGenreId()
 {
     IMusicClient client = new MusicClient("test", "gb", new MockApiRequestHandler(Resources.product_parse_tests));
     string nullGenreId = null;
     await client.GetTopProductsForGenreAsync(nullGenreId, Category.Album);
 }
 public void EnsureGetTopProductsForGenreAsyncThrowsExceptionForNullGenre()
 {
     IMusicClient client = new MusicClient("test", "gb", new MockApiRequestHandler(Resources.product_parse_tests));
     Genre nullGenre = null;
     client.GetTopProductsForGenreAsync(nullGenre, Category.Album);
 }
        public async void EnsureGetTopProductsForGenreAsyncReturnsItems()
        {
            // Only test happy path, as the MusicClient tests cover the unhappy path
            IMusicClient client = new MusicClient("test", "gb", new MockApiRequestHandler(Resources.product_parse_tests));
            ListResponse<Product> result = await client.GetTopProductsForGenreAsync("rock", Category.Album);
            Assert.Greater(result.Result.Count, 0, "Expected more than 0 results");

            result = await client.GetTopProductsForGenreAsync(new Genre() { Id = "rock" }, Category.Album);
            Assert.Greater(result.Result.Count, 0, "Expected more than 0 results");
        }