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

                await Assert.ThrowsAsync <ArgumentException>(() => client.GetRepositoryInstallationForCurrent("", "ducks"));

                await Assert.ThrowsAsync <ArgumentException>(() => client.GetRepositoryInstallationForCurrent("mighty", ""));
            }
Ejemplo n.º 2
0
            public void GetsFromCorrectUrlByRepositoryId()
            {
                var connection = Substitute.For <IApiConnection>();
                var client     = new GitHubAppsClient(connection);

                client.GetRepositoryInstallationForCurrent(1234);

                connection.Received().Get <Installation>(Arg.Is <Uri>(u => u.ToString() == "repositories/1234/installation"), null, "application/vnd.github.machine-man-preview+json");
            }