Пример #1
0
            public async Task EnsuresNonEmptyArguments()
            {
                var connection = Substitute.For <IApiConnection>();
                var client     = new CheckSuitesClient(connection);

                var newCheckSuite = new NewCheckSuite("123abc");

                await Assert.ThrowsAsync <ArgumentException>(() => client.Create("", "repo", newCheckSuite));

                await Assert.ThrowsAsync <ArgumentException>(() => client.Create("fake", "", newCheckSuite));
            }
Пример #2
0
            public async Task RequestsCorrectUrlWithRepositoryId()
            {
                var connection = Substitute.For <IApiConnection>();
                var client     = new CheckSuitesClient(connection);

                var newCheckSuite = new NewCheckSuite("123abc");

                await client.Create(1, newCheckSuite);

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