/// <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; }
public InstrumentStorageServiceTests() { _storageClientMock = new Mock <BlobServiceClient>(); _instrumentStorageService = new InstrumentStorageService(_storageClientMock.Object); }
/// <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; }