public async Task EnsureNormalCallWorksAsExpected() { var client = new MusicClient("test", "gb", new MockApiRequestHandler(Resources.usereventlist)); client.SetAuthenticationToken(AuthTokenTests.GetTestAuthToken()); var result = await client.GetUserPlayHistoryAsync(); 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 Task EnsureNormalCallWorksAsExpected() { var client = new MusicClient("test", "gb", new MockApiRequestHandler(Resources.usereventlist)); client.SetAuthenticationToken(AuthTokenTests.GetTestAuthToken()); var result = await client.GetUserPlayHistoryAsync(); 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 Task EnsureAuthRequiredExceptionThrownForUnAuthedClient() { var client = new MusicClient("test", "gb", new MockApiRequestHandler(FakeResponse.NotFound())); var result = await client.GetUserPlayHistoryAsync(); }
public async Task EnsureAuthRequiredExceptionThrownForUnAuthedClient() { var client = new MusicClient("test", "gb", new MockApiRequestHandler(FakeResponse.NotFound())); var result = await client.GetUserPlayHistoryAsync(); }