From 9b83dc81d7933f06b544331af198d2576abc67c7 Mon Sep 17 00:00:00 2001 From: Jericho Date: Mon, 18 Jan 2021 16:37:03 -0500 Subject: [PATCH] (GH-361) Fix unit test for GlobalSuppressions.GetAllAsync --- .../Resources/GlobalSuppressionTests.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Source/StrongGrid.UnitTests/Resources/GlobalSuppressionTests.cs b/Source/StrongGrid.UnitTests/Resources/GlobalSuppressionTests.cs index 27668b35..a2f25fb3 100644 --- a/Source/StrongGrid.UnitTests/Resources/GlobalSuppressionTests.cs +++ b/Source/StrongGrid.UnitTests/Resources/GlobalSuppressionTests.cs @@ -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", "; rel=\"next\"; title=\"1\", ; rel=\"prev\"; title=\"1\", ; rel=\"last\"; title=\"1\", ; rel=\"first\"; title=\"1\""); + response.Content = new StringContent(GLOBALLY_UNSUBSCRIBED); + return response; + }); var client = Utils.GetFluentClient(mockHttp); var globalSuppressions = new GlobalSuppressions(client);