public New ( string adminEmail, string roleId, string message ) : Task |
||
adminEmail | string | Email of administrator to add. |
roleId | string | Initial role for current instance (see role.get()). |
message | string | Message that will be sent along with invitation to instance. |
return | Task |
public async Task New_WithNullMessage_ThrowsException(AdministratorSyncanoClient client) { try { //when await client.New("*****@*****.**", TestData.RoleId, null); throw new Exception("New should throw an exception"); } catch (Exception e) { //then e.ShouldBeType<ArgumentNullException>(); } }
public async Task New_WithNullAdminEmail_ThrowsException(AdministratorSyncanoClient client) { try { //when await client.New(null, TestData.RoleId, "invitation message"); throw new Exception("New should throw an exception"); } catch (Exception e) { //then e.ShouldBeType<ArgumentNullException>(); } }
public async Task New_CreatesNewAdmin(AdministratorSyncanoClient client) { //given var email = "*****@*****.**"; //when var result = await client.New(email, "4", "Invite message"); //then result.ShouldBeTrue(); //cleanup //there is no api for canceling invitations. /* var admin = await client.GetOne(adminEmail: email); await client.Delete(adminId: admin.Id);*/ }
public async Task New_WithInvalidRoleId_ThrowsException(AdministratorSyncanoClient client) { try { //when await client.New("*****@*****.**", "99", "invitation message"); throw new Exception("New should throw an exception"); } catch (Exception e) { //then e.ShouldBeType<SyncanoException>(); } }
public async Task Delete_DeletesAdmin(AdministratorSyncanoClient client) { //given var email = "*****@*****.**"; await client.New(email, "4", "Invite message"); //when var result = await client.Delete(adminEmail: email); //then result.ShouldBeTrue(); }