public async Task Disposes_ApiConnection_it_creates_on_dispose() { var authClient = new AuthenticationApiClient("dotnet.auth0.com"); authClient.Dispose(); await Assert.ThrowsAsync <ObjectDisposedException>(() => authClient.StartPasswordlessSmsFlowAsync(new Models.PasswordlessSmsRequest())); }
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 connection = new FakeConnection(); var authClient = new AuthenticationApiClient("https://docs.auth0.com", connection); authClient.Dispose(); Assert.False(connection.IsDisposed); }
public async Task DisposeAsync() { if (_connection != null) { await _managementApiClient.Connections.DeleteAsync(_connection.Id); } _managementApiClient.Dispose(); _authenticationApiClient.Dispose(); }