示例#1
0
        public async Task EnsuresNonNullArguments()
        {
            var connection = Substitute.For <IApiConnection>();
            var client     = new RepositoryInvitationsClient(connection);

            await Assert.ThrowsAsync <ArgumentNullException>(() => client.GetAllForRepository(1, null));
        }
示例#2
0
        public async Task RequestsCorrectUrl()
        {
            var connection = Substitute.For <IApiConnection>();
            var client     = new RepositoryInvitationsClient(connection);

            await client.GetAllForRepository(1);

            connection.Received().GetAll <RepositoryInvitation>(Arg.Is <Uri>(u => u.ToString() == "repositories/1/invitations"), null, "application/vnd.github.swamp-thing-preview+json", Args.ApiOptions);
        }