public async Task EnsureInvalidApiCredentialsExceptionThrownWhenServerGives403() { CountryResolver client = new CountryResolver("badkey", new MockApiRequestHandler(FakeResponse.Forbidden())); await client.CheckAvailabilityAsync("gb"); }
public async Task EnsureInvalidApiCredentialsExceptionThrownWhenServerGives403ForItemMethods2() { MusicClient client = new MusicClient("badkey", "us", new MockApiRequestHandler(FakeResponse.Forbidden())); Response <Product> response = await client.GetProductAsync("test"); Assert.IsNotNull(response.Error, "Expected an Error"); Assert.AreEqual(typeof(InvalidApiCredentialsException), response.Error.GetType(), "Expected an InvalidApiCredentialsException"); }