GetOne() public method

Gets admin info with specific id or email from the current instance. Admin_id/admin_email parameter means that one can use either one of them - admin_id or admin_email.
public GetOne ( string adminId = null, string adminEmail = null ) : Task
adminId string Admin id.
adminEmail string Admin email.
return Task
コード例 #1
0
 public async Task GetOne_WithNullAdminIdAndEmail_ThrowsException(AdministratorSyncanoClient client)
 {
     try
     {
         //when
         await client.GetOne();
         throw new Exception("GetOne should throw an exception");
     }
     catch (Exception e)
     {
         //then
         e.ShouldBeType<ArgumentNullException>();
     }
 }
コード例 #2
0
 public async Task GetOne_WithInvalidAdminEmail_ThrowsException(AdministratorSyncanoClient client)
 {
     try
     {
         //when
         await client.GetOne(adminEmail: "*****@*****.**");
         throw new Exception("GetOne should throw an exception");
     }
     catch (Exception e)
     {
         //then
         e.ShouldBeType<SyncanoException>();
     }
 }
コード例 #3
0
        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);
        }