public async Task BarionClient_ShouldThrowException_IfAlreadyDisposed() { var operation = PrepareValidOperation(); _httpMessageHandler.HttpResponseMessage = PrepareValidResponse(); _barionClient.Dispose(); await Assert.ThrowsAsync <ObjectDisposedException>(async() => await _barionClient.ExecuteAsync(operation)); }
protected override void Dispose(bool disposing) { if (disposing && !_disposed) { _disposed = true; if (_barionClient != null) { _barionClient.Dispose(); _barionClient = null; } } base.Dispose(disposing); }