Beispiel #1
0
 /// <summary>
 /// Instruments history service constructor
 /// Sets up the required services and objects
 /// </summary>
 /// <param name="configuration">Configuration object</param>
 /// <param name="httpClientFactory">Http client factory</param>
 /// <param name="dbContext">Database context</param>
 /// <param name="instrumentStorageService">Instrument storage service</param>
 /// <param name="mapper">Auto mapper service</param>
 public InstrumentHistoryService(
     IConfiguration configuration,
     IHttpClientFactory httpClientFactory,
     ForexMinerHeimdallrDbContext dbContext,
     IInstrumentStorageService instrumentStorageService,
     IMapper mapper,
     IOandaApiConnectionFactory oandaApiConnectionFactory
     )
 {
     _configuration            = configuration;
     _httpClientFactory        = httpClientFactory;
     _retryPolicy              = Policy.Handle <HttpRequestException>().RetryAsync(int.Parse(_configuration["forex-miner-thor:Max-Retries"]));
     _dbContext                = dbContext;
     _instrumentStorageService = instrumentStorageService;
     _mapper = mapper;
     _oandaApiConnectionFactory = oandaApiConnectionFactory;
 }
Beispiel #2
0
 public InstrumentStorageServiceTests()
 {
     _storageClientMock        = new Mock <BlobServiceClient>();
     _instrumentStorageService = new InstrumentStorageService(_storageClientMock.Object);
 }
Beispiel #3
0
 /// <summary>
 /// Instrument candles controller constructor
 /// Sets up the required service
 /// </summary>
 /// <param name="instrumentStorageService">The storage service where the instruments are stored</param>
 public InstrumentCandlesController(IInstrumentStorageService instrumentStorageService)
 {
     _instrumentStorageService = instrumentStorageService;
 }