Skip to content

Commit

Permalink
(GH-361) Fix unit test for GlobalSuppressions.GetAllAsync
Browse files Browse the repository at this point in the history
  • Loading branch information
Jericho committed Jan 18, 2021
1 parent 87cb168 commit 0a910ac
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,13 @@ public async Task GetAll()
{
// Arrange
var mockHttp = new MockHttpMessageHandler();
mockHttp.Expect(HttpMethod.Get, Utils.GetSendGridApiUri("suppression/unsubscribes")).Respond("application/json", GLOBALLY_UNSUBSCRIBED);
mockHttp.Expect(HttpMethod.Get, Utils.GetSendGridApiUri("suppression/unsubscribes")).Respond((HttpRequestMessage request) =>
{
var response = new HttpResponseMessage(HttpStatusCode.OK);
response.Headers.Add("link", "<https://api.sendgrid.com/v3/suppression/unsubscribes?limit=50&offset=0>; rel=\"next\"; title=\"1\", <https://api.sendgrid.com/v3/suppression/unsubscribes?limit=50&offset=0>; rel=\"prev\"; title=\"1\", <https://api.sendgrid.com/v3/suppression/unsubscribes?limit=50&offset=0>; rel=\"last\"; title=\"1\", <https://api.sendgrid.com/v3/suppression/unsubscribes?limit=50&offset=0>; rel=\"first\"; title=\"1\"");
response.Content = new StringContent(GLOBALLY_UNSUBSCRIBED);
return response;
});

var client = Utils.GetFluentClient(mockHttp);
var globalSuppressions = new GlobalSuppressions(client);
Expand Down

0 comments on commit 0a910ac

Please sign in to comment.