Exemplo n.º 1
0
        public void CanCreateAndDeleteOrganizationMemberships()
        {
            var org = api.Organizations.CreateOrganization(new Organization()
            {
                Name = "Test Org"
            });

            var user = new User()
            {
                Name = "Test User Org Mem",
                Email = "*****@*****.**",
                Role = "end-user"
            };


            var res = api.Users.CreateUser(user);

            var org_membership = new OrganizationMembership() { UserId = res.User.Id, OrganizationId = org.Organization.Id };

            var res2 = api.Organizations.CreateOrganizationMembership(org_membership);

            Assert.Greater(res2.OrganizationMembership.Id, 0);
            Assert.True(api.Organizations.DeleteOrganizationMembership(res2.OrganizationMembership.Id.Value));
            Assert.True(api.Users.DeleteUser(res.User.Id.Value));
            Assert.True(api.Organizations.DeleteOrganization(org.Organization.Id.Value));
        }
Exemplo n.º 2
0
 public async Task<IndividualOrganizationMembershipResponse> CreateOrganizationMembershipAsync(long userId, OrganizationMembership organization_membership)
 {
     var body = new { organization_membership };
     return await GenericPostAsync<IndividualOrganizationMembershipResponse>(string.Format("users/{0}/organization_memberships.json", userId), body);
 }
Exemplo n.º 3
0
 public IndividualOrganizationMembershipResponse CreateOrganizationMembership(long userId, OrganizationMembership organization_membership)
 {
     var body = new { organization_membership };
     return GenericPost<IndividualOrganizationMembershipResponse>(string.Format("users/{0}/organization_memberships.json", userId), body);
 }
Exemplo n.º 4
0
 public async Task<IndividualOrganizationMembershipResponse> CreateOrganizationMembershipAsync(OrganizationMembership organization_membership)
 {
     var body = new { organization_membership };
     return await GenericPostAsync<IndividualOrganizationMembershipResponse>("organization_memberships.json", body);
 }
Exemplo n.º 5
0
 public IndividualOrganizationMembershipResponse CreateOrganizationMembership(OrganizationMembership organization_membership)
 {
     var body = new { organization_membership };
     return GenericPost<IndividualOrganizationMembershipResponse>("organization_memberships.json", body);
 }