public async Task EnsuresNonEmptyArguments()
            {
                var connection = Substitute.For <IApiConnection>();
                var client     = new CheckRunsClient(connection);

                await Assert.ThrowsAsync <ArgumentException>(() => client.GetAllAnnotations("", "repo", 1));

                await Assert.ThrowsAsync <ArgumentException>(() => client.GetAllAnnotations("fake", "", 1));

                await Assert.ThrowsAsync <ArgumentException>(() => client.GetAllAnnotations("", "repo", 1, ApiOptions.None));

                await Assert.ThrowsAsync <ArgumentException>(() => client.GetAllAnnotations("fake", "", 1, ApiOptions.None));
            }
            public async Task RequestsCorrectUrlWithRepositoryId()
            {
                var connection = Substitute.For <IApiConnection>();
                var client     = new CheckRunsClient(connection);

                await client.GetAllAnnotations(1, 1);

                connection.Received().GetAll <CheckRunAnnotation>(
                    Arg.Is <Uri>(u => u.ToString() == "repositories/1/check-runs/1/annotations"),
                    null,
                    "application/vnd.github.antiope-preview+json",
                    Args.ApiOptions);
            }
            public async Task RequestsCorrectUrlWithApiOptions()
            {
                var connection = Substitute.For <IApiConnection>();
                var client     = new CheckRunsClient(connection);

                var options = new ApiOptions {
                    PageSize = 1
                };

                await client.GetAllAnnotations("fake", "repo", 1, options);

                connection.Received().GetAll <CheckRunAnnotation>(
                    Arg.Is <Uri>(u => u.ToString() == "repos/fake/repo/check-runs/1/annotations"),
                    null,
                    "application/vnd.github.antiope-preview+json",
                    options);
            }