From e41b2d19d74d84e5b5222ebce58d64fc308b1c2e Mon Sep 17 00:00:00 2001 From: Brendan Forster Date: Mon, 30 Mar 2020 12:14:14 -0300 Subject: [PATCH] port a client to use the new tests --- Octokit.Tests/Clients/WatchedClientTests.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Octokit.Tests/Clients/WatchedClientTests.cs b/Octokit.Tests/Clients/WatchedClientTests.cs index 5d59d9d1..287d9814 100644 --- a/Octokit.Tests/Clients/WatchedClientTests.cs +++ b/Octokit.Tests/Clients/WatchedClientTests.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Net; +using System.Net.Http; using System.Threading.Tasks; using NSubstitute; using Octokit.Internal; @@ -231,7 +232,9 @@ namespace Octokit.Tests.Clients var endpoint = new Uri("repos/fight/club/subscription", UriKind.Relative); var connection = Substitute.For(); - var response = new Response(HttpStatusCode.NotFound, null, new Dictionary(), "application/json"); + var response = new HttpResponseMessage(); + response.StatusCode = HttpStatusCode.NotFound; + response.Headers.Add("Content-Type", "application/json"); connection.Get(endpoint).Returns>(x => { throw new NotFoundException(response); @@ -250,7 +253,11 @@ namespace Octokit.Tests.Clients var endpoint = new Uri("repositories/1/subscription", UriKind.Relative); var connection = Substitute.For(); - var response = new Response(HttpStatusCode.NotFound, null, new Dictionary(), "application/json"); + + var response = new HttpResponseMessage(); + response.StatusCode = HttpStatusCode.NotFound; + response.Headers.Add("Content-Type", "application/json"); + connection.Get(endpoint).Returns>(x => { throw new NotFoundException(response);