add convention test for preview APIs (#2154)

This commit is contained in:
Brendan Forster
2020-03-18 08:52:50 -03:00
committed by GitHub
parent e9516bb6c1
commit 327020750f
44 changed files with 497 additions and 509 deletions
@@ -30,7 +30,7 @@ namespace Octokit.Tests.Reactive
client.GetAllForIssue("fake", "repo", 42);
connection.Received().Get<List<Label>>(Arg.Is<Uri>(u => u.ToString() == "repos/fake/repo/issues/42/labels"), Args.EmptyDictionary, "application/vnd.github.symmetra-preview+json");
connection.Received().Get<List<Label>>(Arg.Is<Uri>(u => u.ToString() == "repos/fake/repo/issues/42/labels"), Args.EmptyDictionary, null);
}
[Fact]
@@ -42,7 +42,7 @@ namespace Octokit.Tests.Reactive
client.GetAllForIssue(1, 42);
connection.Received().Get<List<Label>>(Arg.Is<Uri>(u => u.ToString() == "repositories/1/issues/42/labels"), Args.EmptyDictionary, "application/vnd.github.symmetra-preview+json");
connection.Received().Get<List<Label>>(Arg.Is<Uri>(u => u.ToString() == "repositories/1/issues/42/labels"), Args.EmptyDictionary, null);
}
[Fact]
@@ -61,7 +61,7 @@ namespace Octokit.Tests.Reactive
client.GetAllForIssue("fake", "repo", 42, options);
connection.Received().Get<List<Label>>(Arg.Is<Uri>(u => u.ToString() == "repos/fake/repo/issues/42/labels"), Arg.Is<Dictionary<string, string>>(d => d.Count == 2), "application/vnd.github.symmetra-preview+json");
connection.Received().Get<List<Label>>(Arg.Is<Uri>(u => u.ToString() == "repos/fake/repo/issues/42/labels"), Arg.Is<Dictionary<string, string>>(d => d.Count == 2), null);
}
[Fact]
@@ -80,7 +80,7 @@ namespace Octokit.Tests.Reactive
client.GetAllForIssue(1, 42, options);
connection.Received().Get<List<Label>>(Arg.Is<Uri>(u => u.ToString() == "repositories/1/issues/42/labels"), Arg.Is<Dictionary<string, string>>(d => d.Count == 2), "application/vnd.github.symmetra-preview+json");
connection.Received().Get<List<Label>>(Arg.Is<Uri>(u => u.ToString() == "repositories/1/issues/42/labels"), Arg.Is<Dictionary<string, string>>(d => d.Count == 2), null);
}
[Fact]
@@ -114,7 +114,7 @@ namespace Octokit.Tests.Reactive
client.GetAllForRepository("fake", "repo");
connection.Received().Get<List<Label>>(Arg.Is<Uri>(u => u.ToString() == "repos/fake/repo/labels"), Args.EmptyDictionary, "application/vnd.github.symmetra-preview+json");
connection.Received().Get<List<Label>>(Arg.Is<Uri>(u => u.ToString() == "repos/fake/repo/labels"), Args.EmptyDictionary, null);
}
[Fact]
@@ -126,7 +126,7 @@ namespace Octokit.Tests.Reactive
client.GetAllForRepository(1);
connection.Received().Get<List<Label>>(Arg.Is<Uri>(u => u.ToString() == "repositories/1/labels"), Args.EmptyDictionary, "application/vnd.github.symmetra-preview+json");
connection.Received().Get<List<Label>>(Arg.Is<Uri>(u => u.ToString() == "repositories/1/labels"), Args.EmptyDictionary, null);
}
[Fact]
@@ -145,7 +145,7 @@ namespace Octokit.Tests.Reactive
client.GetAllForRepository("fake", "repo", options);
connection.Received().Get<List<Label>>(Arg.Is<Uri>(u => u.ToString() == "repos/fake/repo/labels"), Arg.Is<Dictionary<string, string>>(d => d.Count == 2), "application/vnd.github.symmetra-preview+json");
connection.Received().Get<List<Label>>(Arg.Is<Uri>(u => u.ToString() == "repos/fake/repo/labels"), Arg.Is<Dictionary<string, string>>(d => d.Count == 2), null);
}
[Fact]
@@ -164,7 +164,7 @@ namespace Octokit.Tests.Reactive
client.GetAllForRepository(1, options);
connection.Received().Get<List<Label>>(Arg.Is<Uri>(u => u.ToString() == "repositories/1/labels"), Arg.Is<Dictionary<string, string>>(d => d.Count == 2), "application/vnd.github.symmetra-preview+json");
connection.Received().Get<List<Label>>(Arg.Is<Uri>(u => u.ToString() == "repositories/1/labels"), Arg.Is<Dictionary<string, string>>(d => d.Count == 2), null);
}
[Fact]
@@ -198,7 +198,7 @@ namespace Octokit.Tests.Reactive
client.GetAllForMilestone("fake", "repo", 42);
connection.Received().Get<List<Label>>(Arg.Is<Uri>(u => u.ToString() == "repos/fake/repo/milestones/42/labels"), Args.EmptyDictionary, "application/vnd.github.symmetra-preview+json");
connection.Received().Get<List<Label>>(Arg.Is<Uri>(u => u.ToString() == "repos/fake/repo/milestones/42/labels"), Args.EmptyDictionary, null);
}
[Fact]
@@ -210,7 +210,7 @@ namespace Octokit.Tests.Reactive
client.GetAllForMilestone(1, 42);
connection.Received().Get<List<Label>>(Arg.Is<Uri>(u => u.ToString() == "repositories/1/milestones/42/labels"), Args.EmptyDictionary, "application/vnd.github.symmetra-preview+json");
connection.Received().Get<List<Label>>(Arg.Is<Uri>(u => u.ToString() == "repositories/1/milestones/42/labels"), Args.EmptyDictionary, null);
}
[Fact]
@@ -229,7 +229,7 @@ namespace Octokit.Tests.Reactive
client.GetAllForMilestone("fake", "repo", 42, options);
connection.Received().Get<List<Label>>(Arg.Is<Uri>(u => u.ToString() == "repos/fake/repo/milestones/42/labels"), Arg.Is<Dictionary<string, string>>(d => d.Count == 2), "application/vnd.github.symmetra-preview+json");
connection.Received().Get<List<Label>>(Arg.Is<Uri>(u => u.ToString() == "repos/fake/repo/milestones/42/labels"), Arg.Is<Dictionary<string, string>>(d => d.Count == 2), null);
}
[Fact]
@@ -248,7 +248,7 @@ namespace Octokit.Tests.Reactive
client.GetAllForMilestone(1, 42, options);
connection.Received().Get<List<Label>>(Arg.Is<Uri>(u => u.ToString() == "repositories/1/milestones/42/labels"), Arg.Is<Dictionary<string, string>>(d => d.Count == 2), "application/vnd.github.symmetra-preview+json");
connection.Received().Get<List<Label>>(Arg.Is<Uri>(u => u.ToString() == "repositories/1/milestones/42/labels"), Arg.Is<Dictionary<string, string>>(d => d.Count == 2), null);
}
[Fact]
@@ -367,7 +367,7 @@ namespace Octokit.Tests.Reactive
client.RemoveFromIssue("fake", "repo", 42, "label");
connection.Received().Delete<IReadOnlyList<Label>>(Arg.Is<Uri>(u => u.ToString() == "repos/fake/repo/issues/42/labels/label"), Arg.Any<object>(), "application/vnd.github.symmetra-preview+json");
connection.Received().Delete<IReadOnlyList<Label>>(Arg.Is<Uri>(u => u.ToString() == "repos/fake/repo/issues/42/labels/label"), Arg.Any<object>());
}
[Fact]
@@ -379,7 +379,7 @@ namespace Octokit.Tests.Reactive
client.RemoveFromIssue(1, 42, "label");
connection.Received().Delete<IReadOnlyList<Label>>(Arg.Is<Uri>(u => u.ToString() == "repositories/1/issues/42/labels/label"), Arg.Any<object>(), "application/vnd.github.symmetra-preview+json");
connection.Received().Delete<IReadOnlyList<Label>>(Arg.Is<Uri>(u => u.ToString() == "repositories/1/issues/42/labels/label"), Arg.Any<object>());
}
[Fact]