public Task<bool> Authorize(string apiClientId, ApiKeyPermission permission) { if(apiClientId == null) throw new ArgumentNullException(); return _syncanoClient.GetAsync("apikey.authorize", new {api_client_id = apiClientId, permission = ApiKeyPermissionByStringConverter.GetString(permission)}); }
public async Task Authorize_WithNullApiKeyId_ThrowsException(ApiKeySyncanoClient client) { try { //when await client.Authorize(null, ApiKeyPermission.AccessSync); throw new Exception("Authorize should throw an exception"); } catch (Exception e) { //then e.ShouldBeType<ArgumentNullException>(); } }