Esempio n. 1
0
        public async Task RequestsCorrectUrl()
        {
            var connection        = Substitute.For <IApiConnection>();
            var client            = new RepositoryInvitationsClient(connection);
            var updatedInvitation = new InvitationUpdate(InvitationPermissionType.Read);

            await client.Edit(1, 2, updatedInvitation);

            connection.Received().Patch <RepositoryInvitation>(Arg.Is <Uri>(u => u.ToString() == "repositories/1/invitations/2"), Arg.Is <InvitationUpdate>(updatedInvitation), "application/vnd.github.swamp-thing-preview+json");
        }
Esempio n. 2
0
        public async Task EnsureNonNullArguments()
        {
            var client = new RepositoryInvitationsClient(Substitute.For <IApiConnection>());

            await Assert.ThrowsAsync <ArgumentNullException>(() => client.Edit(1, 2, null));
        }