Skip to content

Commit 0a910ac

Browse files
committed
(GH-361) Fix unit test for GlobalSuppressions.GetAllAsync
1 parent 87cb168 commit 0a910ac

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Source/StrongGrid.UnitTests/Resources/GlobalSuppressionTests.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,13 @@ public async Task GetAll()
3636
{
3737
// Arrange
3838
var mockHttp = new MockHttpMessageHandler();
39-
mockHttp.Expect(HttpMethod.Get, Utils.GetSendGridApiUri("suppression/unsubscribes")).Respond("application/json", GLOBALLY_UNSUBSCRIBED);
39+
mockHttp.Expect(HttpMethod.Get, Utils.GetSendGridApiUri("suppression/unsubscribes")).Respond((HttpRequestMessage request) =>
40+
{
41+
var response = new HttpResponseMessage(HttpStatusCode.OK);
42+
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\"");
43+
response.Content = new StringContent(GLOBALLY_UNSUBSCRIBED);
44+
return response;
45+
});
4046

4147
var client = Utils.GetFluentClient(mockHttp);
4248
var globalSuppressions = new GlobalSuppressions(client);

0 commit comments

Comments
 (0)