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

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

            await client.GetAllForCurrent();

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