public SetupCointrackingService(string testDataFilename)
        {
            var mock = new Mock <HttpMessageHandler>();

            fs = File.OpenRead(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "TestData", testDataFilename + ".json"));

            var response = new HttpResponseMessage
            {
                StatusCode = System.Net.HttpStatusCode.OK,
                Content    = new StreamContent(fs)
            };

            mock.Protected().Setup <Task <HttpResponseMessage> >(
                "SendAsync",
                ItExpr.IsAny <HttpRequestMessage>(),
                ItExpr.IsAny <CancellationToken>())
            .ReturnsAsync(response);

            IOptions <CoinTrackingOptions> coinTrackingOptions = Options.Create(new CoinTrackingOptions()
            {
                Client = new HttpClient(mock.Object),
                Key    = "a",
                Secret = "b"
            });

            cointracking = new CoinTrackingService.LocalImport(coinTrackingOptions, null);
        }
 public void Dispose()
 {
     cointracking = null;
     if (fs != null && fs is IDisposable)
     {
         fs.Dispose();
     }
 }