public async Task RequestsCorrectUrlWithRepositoryId()
            {
                var connection   = Substitute.For <IConnection>();
                var gitHubClient = new GitHubClient(connection);
                var client       = new ObservableCheckSuitesClient(gitHubClient);

                client.GetAllForReference(1, "ref");

                connection.Received().Get <List <CheckSuitesResponse> >(
                    Arg.Is <Uri>(u => u.ToString() == "repositories/1/commits/ref/check-suites"),
                    Args.EmptyDictionary,
                    "application/vnd.github.antiope-preview+json");
            }
            public async Task RequestsCorrectUrlWithRequest()
            {
                var connection   = Substitute.For <IConnection>();
                var gitHubClient = new GitHubClient(connection);
                var client       = new ObservableCheckSuitesClient(gitHubClient);

                var request = new CheckSuiteRequest
                {
                    AppId     = 123,
                    CheckName = "build"
                };

                client.GetAllForReference("fake", "repo", "ref", request);

                connection.Received().Get <List <CheckSuitesResponse> >(
                    Arg.Is <Uri>(u => u.ToString() == "repos/fake/repo/commits/ref/check-suites"),
                    Arg.Is <Dictionary <string, string> >(x =>
                                                          x["app_id"] == "123" &&
                                                          x["check_name"] == "build"),
                    "application/vnd.github.antiope-preview+json");
            }
            public async Task EnsuresNonEmptyArguments()
            {
                var gitHubClient = Substitute.For <IGitHubClient>();
                var client       = new ObservableCheckSuitesClient(gitHubClient);

                var request = new CheckSuiteRequest();

                Assert.Throws <ArgumentException>(() => client.GetAllForReference("", "repo", "ref"));
                Assert.Throws <ArgumentException>(() => client.GetAllForReference("fake", "", "ref"));
                Assert.Throws <ArgumentException>(() => client.GetAllForReference("fake", "repo", ""));

                Assert.Throws <ArgumentException>(() => client.GetAllForReference("", "repo", "ref", request));
                Assert.Throws <ArgumentException>(() => client.GetAllForReference("fake", "", "ref", request));
                Assert.Throws <ArgumentException>(() => client.GetAllForReference("fake", "repo", "", request));

                Assert.Throws <ArgumentException>(() => client.GetAllForReference("", "repo", "ref", request, ApiOptions.None));
                Assert.Throws <ArgumentException>(() => client.GetAllForReference("fake", "", "ref", request, ApiOptions.None));
                Assert.Throws <ArgumentException>(() => client.GetAllForReference("fake", "repo", "", request, ApiOptions.None));

                Assert.Throws <ArgumentException>(() => client.GetAllForReference(1, ""));

                Assert.Throws <ArgumentException>(() => client.GetAllForReference(1, "", request));

                Assert.Throws <ArgumentException>(() => client.GetAllForReference(1, "", request, ApiOptions.None));
            }