using System.Collections.Generic; using System.Net; using System.Threading.Tasks; namespace Octokit.Internal { public static class TestSetup { public static Task> CreateApiResponse(HttpStatusCode statusCode) { var response = CreateResponse(statusCode); return Task.FromResult>(new ApiResponse(response)); } public static IResponse CreateResponse(HttpStatusCode statusCode) { object body = null; return CreateResponse(statusCode, body); } public static IResponse CreateResponse(HttpStatusCode statusCode, IDictionary headers) { var response = new Response(statusCode, null, headers, "application/json"); return response; } public static IResponse CreateResponse(HttpStatusCode statusCode, object body) { var response = new Response(statusCode, body, new Dictionary(), "application/json"); return response; } public static IResponse CreateResponse(HttpStatusCode statusCode, object body, IDictionary headers) { return CreateResponse(statusCode, body, headers, "application/json"); } public static IResponse CreateResponse(HttpStatusCode statusCode, object body, IDictionary headers, string contentType) { var response = new Response(statusCode, body, headers, contentType); return response; } } }