feat: Removing accept header previews (#2515)

This commit is contained in:
Chris Simpson
2022-08-01 15:37:23 +01:00
committed by GitHub
parent 840935a8d7
commit 2f7bd00dd6
138 changed files with 954 additions and 1659 deletions
@@ -38,15 +38,14 @@ namespace Octokit.Tests.Reactive
IApiResponse<List<TimelineEventInfo>> response = new ApiResponse<List<TimelineEventInfo>>(
CreateResponse(HttpStatusCode.OK),
result);
gitHubClient.Connection.Get<List<TimelineEventInfo>>(Args.Uri, Args.EmptyDictionary, "application/vnd.github.mockingbird-preview+json")
gitHubClient.Connection.Get<List<TimelineEventInfo>>(Args.Uri, Args.EmptyDictionary)
.Returns(Task.FromResult(response));
var timelineEvents = await client.GetAllForIssue("fake", "repo", 42).ToList();
connection.Received().Get<List<TimelineEventInfo>>(
Arg.Is<Uri>(u => u.ToString() == "repos/fake/repo/issues/42/timeline"),
Arg.Any<Dictionary<string, string>>(),
"application/vnd.github.mockingbird-preview+json");
Arg.Any<Dictionary<string, string>>());
Assert.Equal(1, timelineEvents.Count);
}
@@ -60,15 +59,14 @@ namespace Octokit.Tests.Reactive
var client = new ObservableIssueTimelineClient(gitHubClient);
IApiResponse<List<TimelineEventInfo>> response = new ApiResponse<List<TimelineEventInfo>>(CreateResponse(HttpStatusCode.OK), result);
gitHubClient.Connection.Get<List<TimelineEventInfo>>(Args.Uri, Arg.Is<Dictionary<string, string>>(d => d.Count == 1), "application/vnd.github.mockingbird-preview+json")
gitHubClient.Connection.Get<List<TimelineEventInfo>>(Args.Uri, Arg.Is<Dictionary<string, string>>(d => d.Count == 1))
.Returns(Task.FromResult(response));
var timelineEvents = await client.GetAllForIssue("fake", "repo", 42, new ApiOptions { PageSize = 30 }).ToList();
connection.Received().Get<List<TimelineEventInfo>>(
Arg.Is<Uri>(u => u.ToString() == "repos/fake/repo/issues/42/timeline"),
Arg.Is<Dictionary<string, string>>(d => d.Count == 1 && d["per_page"] == "30"),
"application/vnd.github.mockingbird-preview+json");
Arg.Is<Dictionary<string, string>>(d => d.Count == 1 && d["per_page"] == "30"));
Assert.Equal(1, timelineEvents.Count);
}
@@ -81,15 +79,14 @@ namespace Octokit.Tests.Reactive
var client = new ObservableIssueTimelineClient(githubClient);
IApiResponse<List<TimelineEventInfo>> response = new ApiResponse<List<TimelineEventInfo>>(CreateResponse(HttpStatusCode.OK), result);
githubClient.Connection.Get<List<TimelineEventInfo>>(Args.Uri, Args.EmptyDictionary, "application/vnd.github.mockingbird-preview+json")
githubClient.Connection.Get<List<TimelineEventInfo>>(Args.Uri, Args.EmptyDictionary)
.Returns(Task.FromResult(response));
var timelineEvents = await client.GetAllForIssue(1, 42).ToList();
connection.Received().Get<List<TimelineEventInfo>>(
Arg.Is<Uri>(u => u.ToString() == "repositories/1/issues/42/timeline"),
Arg.Any<Dictionary<string, string>>(),
"application/vnd.github.mockingbird-preview+json");
Arg.Any<Dictionary<string, string>>());
Assert.Equal(1, timelineEvents.Count);
}
@@ -102,15 +99,14 @@ namespace Octokit.Tests.Reactive
var client = new ObservableIssueTimelineClient(githubClient);
IApiResponse<List<TimelineEventInfo>> response = new ApiResponse<List<TimelineEventInfo>>(CreateResponse(HttpStatusCode.OK), result);
githubClient.Connection.Get<List<TimelineEventInfo>>(Args.Uri, Arg.Is<Dictionary<string, string>>(d => d.Count == 1), "application/vnd.github.mockingbird-preview+json")
githubClient.Connection.Get<List<TimelineEventInfo>>(Args.Uri, Arg.Is<Dictionary<string, string>>(d => d.Count == 1))
.Returns(Task.FromResult(response));
var timelineEvents = await client.GetAllForIssue(1, 42, new ApiOptions { PageSize = 30 }).ToList();
connection.Received().Get<List<TimelineEventInfo>>(
Arg.Is<Uri>(u => u.ToString() == "repositories/1/issues/42/timeline"),
Arg.Is<Dictionary<string, string>>(d => d.Count == 1 && d["per_page"] == "30"),
"application/vnd.github.mockingbird-preview+json");
Arg.Is<Dictionary<string, string>>(d => d.Count == 1 && d["per_page"] == "30"));
Assert.Equal(1, timelineEvents.Count);
}