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

                var update = new CheckRunUpdate {
                    Status = CheckStatus.InProgress
                };

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

                await Assert.ThrowsAsync <ArgumentException>(() => client.Update("fake", "", 1, update));
            }
Example #2
0
            public async Task RequestsCorrectUrl()
            {
                var connection = Substitute.For <IApiConnection>();
                var client     = new CheckRunsClient(connection);

                var update = new CheckRunUpdate {
                    Status = CheckStatus.InProgress
                };

                await client.Update("fake", "repo", 1, update);

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