public async Task Disposes_Connection_it_creates_on_dispose() { var diposeManagement = new ManagementApiClient("token", "test"); diposeManagement.Dispose(); await Assert.ThrowsAsync <ObjectDisposedException>(() => diposeManagement.Clients.GetAsync("1")); }
public async Task DisposeAsync() { if (_user != null) { await _managementApiClient.Users.DeleteAsync(_user.UserId); } if (_userInDefaultDirectory != null) { await _managementApiClient.Users.DeleteAsync(_userInDefaultDirectory.UserId); } if (_plusUser != null) { await _managementApiClient.Users.DeleteAsync(_plusUser.UserId); } if (_connection != null) { await _managementApiClient.Connections.DeleteAsync(_connection.Id); } _managementApiClient.Dispose(); _authenticationApiClient.Dispose(); }
public void Does_not_dispose_connection_it_does_not_create() { var doNotDisposeConnection = new FakeConnection(); var disposeManagement = new ManagementApiClient("token", "test", doNotDisposeConnection); disposeManagement.Dispose(); Assert.False(doNotDisposeConnection.IsDisposed); }
public async Task DisposeAsync() { await _apiClient.Users.DeleteAsync(_user.UserId); await _apiClient.Connections.DeleteAsync(_connection.Id); _apiClient.Dispose(); }
public async Task DisposeAsync() { if (_connection != null) { await _managementApiClient.Connections.DeleteAsync(_connection.Id); } _managementApiClient.Dispose(); _authenticationApiClient.Dispose(); }
public Task DisposeAsync() { // Clean up any log stream entities on the tenant after every test executes var deleteTasks = createdStreams.Select(stream => _apiClient.LogStreams.DeleteAsync(stream.Id)); return(Task.WhenAll(deleteTasks.ToArray()).ContinueWith(_ => { _apiClient.Dispose(); })); }
public async Task DisposeAsync() { await _apiClient.Users.DeleteAsync(_auth0User.UserId); await _apiClient.Connections.DeleteAsync(_auth0Connection.Id); await _apiClient.Users.DeleteAsync(_emailUser.UserId); await _apiClient.Connections.DeleteAsync(_emailConnection.Id); _apiClient.Dispose(); }
public async Task DisposeAsync() { try { await _apiClient.EmailProvider.DeleteAsync(); _apiClient.Dispose(); } catch { // Supress errors } }
public async Task DisposeAsync() { if (_client != null) { await _apiClient.Clients.DeleteAsync(_client.ClientId); } if (_resourceServer != null) { await _apiClient.ResourceServers.DeleteAsync(_resourceServer.Id); } _apiClient.Dispose(); }
public Task DisposeAsync() { _apiClient.Dispose(); return(Task.CompletedTask); }