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

                await Assert.ThrowsAsync <ArgumentNullException>(() => client.GetLicenseContents(null, "repo"));

                await Assert.ThrowsAsync <ArgumentNullException>(() => client.GetLicenseContents("owner", null));
            }
Ejemplo n.º 2
0
            public async Task RequestsTheCorrectUrlWithRepositoryId()
            {
                var connection = Substitute.For <IApiConnection>();
                var client     = new RepositoriesClient(connection);

                await client.GetLicenseContents(1);

                connection.Received()
                .Get <RepositoryContentLicense>(Arg.Is <Uri>(u => u.ToString() == "repositories/1/license"), null, "application/vnd.github.drax-preview+json");
            }