示例#1
0
 /// <summary>
 /// Releases the unmanaged resources and disposes of the managed resources used by the <see cref="System.Net.Http.HttpMessageInvoker"/>.
 /// </summary>
 /// <remarks>
 /// <para>
 /// Remember to call this method once you are done using the client.
 /// </para>
 /// <para>
 /// Read <a href="https://github.com/LeMorrow/APOD.Net#disposing-the-client">https://github.com/LeMorrow/APOD.Net#disposing-the-client</a> to learn more.
 /// </para>
 /// </remarks>
 public void Dispose()
 {
     if (_disposed)
     {
         return;
     }
     _httpRequester.Dispose();
     GC.SuppressFinalize(this);
     _disposed = true;
 }
示例#2
0
        public async Task SendHttpRequestAsync_Today_ThrowsIfDisposed()
        {
            _httpRequester.Dispose();

            await Assert.ThrowsAsync <ObjectDisposedException>(async() => await _httpRequester.SendHttpRequestAsync());
        }
示例#3
0
 /// <summary>
 /// Releases managed and unmanaged resources used by this <see cref="StackExchangeClient"/> object.
 /// </summary>
 public void Dispose()
 {
     httpRequester.Dispose();
 }