Class with Administrator management api.
        public async Task GetRoles_GetsListOfRoles(AdministratorSyncanoClient client)
        {
            //when
            var result = await client.GetRoles();

            //then
            result.ShouldNotBeEmpty();
            result.Count.ShouldEqual(4);
        }
 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();
        }
 public async Task Delete_WithInvalidAdminEmail_ThrowsException(AdministratorSyncanoClient client)
 {
     try
     {
         //when
         await client.Delete(adminEmail:"*****@*****.**");
         throw new Exception("Delete should throw an exception");
     }
     catch (Exception e)
     {
         //then
         e.ShouldBeType<SyncanoException>();
     }
 }
 public async Task Delete_WithNullAdminIdAndEmail_ThrowsException(AdministratorSyncanoClient client)
 {
     try
     {
         //when
         await client.Delete();
         throw new Exception("Delete should throw an exception");
     }
     catch (Exception e)
     {
         //then
         e.ShouldBeType<ArgumentNullException>();
     }
 }
 public async Task Update_WithInvalidRoldeId_ThrowsException(AdministratorSyncanoClient client)
 {
     try
     {
         //when
         await client.Update("99", TestData.AdminId);
         throw new Exception("Update should throw an exception");
     }
     catch (Exception e)
     {
         //then
         e.ShouldBeType<SyncanoException>();
     }
 }
 public async Task Update_WithNullRoleId_ThrowsException(AdministratorSyncanoClient client)
 {
     try
     {
         //when
         await client.Update(null, TestData.AdminId);
         throw new Exception("Update should throw an exception");
     }
     catch (Exception e)
     {
         //then
         e.ShouldBeType<ArgumentNullException>();
     }
 }
 public async Task Update_WithInvalidAdminEmail_ThrowsException(AdministratorSyncanoClient client)
 {
     try
     {
         //when
         await client.Update(TestData.RoleId, adminEmail: "*****@*****.**");
         throw new Exception("Update should throw an exception");
     }
     catch (Exception e)
     {
         //then
         e.ShouldBeType<SyncanoException>();
     }
 }
 public async Task GetOne_WithInvalidAdminId_ThrowsException(AdministratorSyncanoClient client)
 {
     try
     {
         //when
         await client.GetOne("9999");
         throw new Exception("GetOne should throw an exception");
     }
     catch (Exception e)
     {
         //then
         e.ShouldBeType<SyncanoException>();
     }
 }
        public async Task GetOne_ByAdminEmail_CreatesAdministrator(AdministratorSyncanoClient client)
        {
            //when
            var result = await client.GetOne(adminEmail: TestData.AdminEmail);

            //then
            result.ShouldNotBeNull();
            result.Id.ShouldEqual(TestData.AdminId);
        }
        public async Task Get_GetsListOfAdministrator(AdministratorSyncanoClient client)
        {
            //when
            var result = await client.Get();

            //then
            result.ShouldNotBeEmpty();
            result.Count.ShouldBeGreaterThanOrEqualTo(1);
            result.Any(a => a.Role.Id == "1").ShouldBeTrue();
        }