Ejemplo n.º 1
0
        public async Task BarionClient_ShouldThrowException_IfAlreadyDisposed()
        {
            var operation = PrepareValidOperation();

            _httpMessageHandler.HttpResponseMessage = PrepareValidResponse();

            _barionClient.Dispose();

            await Assert.ThrowsAsync <ObjectDisposedException>(async() => await _barionClient.ExecuteAsync(operation));
        }
Ejemplo n.º 2
0
        protected override void Dispose(bool disposing)
        {
            if (disposing && !_disposed)
            {
                _disposed = true;

                if (_barionClient != null)
                {
                    _barionClient.Dispose();
                    _barionClient = null;
                }
            }

            base.Dispose(disposing);
        }