public async static Task <string> GetToken(string baseUrl) { if (!string.IsNullOrEmpty(_token)) { return(_token); } var response = await HttpRequestFactory.PostAnonymous(baseUrl, "authentication/token", new { Username = "******" }); var content = response.ContentAsType <TokenResponse>(); _token = content.Token; return(_token); }
public async Task GivenInvalidAuthorization_ThenUnauthorized() { var response = await HttpRequestFactory.PostAnonymous(_clientApiUrl, _checkoutResourceUrlSegment, new { postalCode = "something" }); Assert.Equal(HttpStatusCode.Unauthorized, response.StatusCode); }