public void EnsureGetArtistsAroundLocationReturnsArtistsForValidSearch()
        {
            IMusicClient client = new MusicClient("test", "test", "gb", new MockApiRequestHandler(Resources.search_artists));
            client.GetArtistsAroundLocation(
                (ListResponse<Artist> result) =>
                {
                    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");

                    foreach (Artist artist in result.Result)
                    {
                        Assert.IsFalse(string.IsNullOrEmpty(artist.Id), "Expected Id to be populated");
                        Assert.IsFalse(string.IsNullOrEmpty(artist.Name), "Expected Name to be populated");
                        Assert.IsNotNull(artist.Genres, "Expected a genre list");
                        Assert.Greater(artist.Genres.Length, 0, "Expected more than 0 genres");
                    }
                },
                51.45534,
                -2.59239);
        }
 public void EnsureGetArtistsAroundLocationReturnsErrorForFailedCall()
 {
     IMusicClient client = new MusicClient("test", "test", "gb", new MockApiRequestHandler(Resources.search_noresults));
     client.GetArtistsAroundLocation(
         (ListResponse<Artist> result) =>
         {
             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.AreEqual(result.Result.Count, 0, "Expected 0 results");
         },
         51.45534,
         -2.59239);
 }
 public void EnsureGetArtistsAroundLocationThrowsExceptionForNullCallback()
 {
     IMusicClient client = new MusicClient("test", "test", "gb", new MockApiRequestHandler(Resources.search_artists));
     client.GetArtistsAroundLocation(null, 51.45534, -2.59239);
 }
 public void EnsureGetArtistsAroundLocationThrowsExceptionForZeroLongitude()
 {
     IMusicClient client = new MusicClient("test", "test", "gb", new MockApiRequestHandler(Resources.search_artists));
     client.GetArtistsAroundLocation((ListResponse<Artist> result) => { }, 51.45534, 0);
 }