UpdateDescription() public method

Updates specified API client's info.
public UpdateDescription ( string description, string apiClientId = null ) : Task
description string New API client's description to set.
apiClientId string API client id. If not specified, will update current API client.
return Task
コード例 #1
0
 public async Task Update_WithNullDescription_ThrowsException(ApiKeySyncanoClient client)
 {
     try
     {
         //when
         await client.UpdateDescription(null);
         throw new Exception("UpdateDescription should throw an exception");
     }
     catch (Exception e)
     {
         //then
         e.ShouldBeType<ArgumentNullException>();
     }
 }
コード例 #2
0
 public async Task Update_WithInvalidApiKeyId_ThrowsException(ApiKeySyncanoClient client)
 {
     try
     {
         //when
         await client.UpdateDescription("description", "abcde123");
         throw new Exception("UpdateDescription should throw an exception");
     }
     catch (Exception e)
     {
         //then
         e.ShouldBeType<SyncanoException>();
     }
 }
コード例 #3
0
        public async Task Update_UpdatesApiKey(ApiKeySyncanoClient client)
        {
            //given
            var description = "apiKey description";
            var newDescription = "new apiKey description";
            var apiKey = await client.New(description, ApiKeyType.Backend, TestData.RoleId);

            //when
            apiKey = await client.UpdateDescription(newDescription, apiKey.Id);

            //then
            apiKey.ShouldNotBeNull();
            apiKey.Description.ShouldEqual(newDescription);

            //cleanup
            await client.Delete(apiKey.Id);
        }