Exemplo n.º 1
0
            public async Task EnsuresNonEmptyArguments()
            {
                var connection = Substitute.For <IApiConnection>();
                var client     = new CheckSuitesClient(connection);

                var request = new CheckSuiteTriggerRequest("123abc");

                await Assert.ThrowsAsync <ArgumentException>(() => client.Request("", "repo", request));

                await Assert.ThrowsAsync <ArgumentException>(() => client.Request("fake", "", request));
            }
Exemplo n.º 2
0
            public async Task RequestsCorrectUrlWithRepositoryId()
            {
                var connection = MockedIApiConnection.PostReturnsHttpStatus(HttpStatusCode.Created);
                var client     = new CheckSuitesClient(connection);

                var request = new CheckSuiteTriggerRequest("123abc");

                await client.Request(1, request);

                connection.Connection.Received().Post(
                    Arg.Is <Uri>(u => u.ToString() == "repositories/1/check-suite-requests"),
                    request,
                    "application/vnd.github.antiope-preview+json");
            }