//[Fact]
        public async void InstrumentsTest()
        {
            var result = await _restClient.InstrumentsAsync();

            Assert.NotEmpty(result);
            Assert.DoesNotContain(result, x => string.IsNullOrEmpty(x.Name));
        }
Esempio n. 2
0
        private void InitializeAssetPairs()
        {
            IReadOnlyCollection <Instrument> instruments;

            _log.Info("Started instrument initialization.");

            while (true)
            {
                try
                {
                    Thread.Sleep(1000);

                    instruments = _b2C2RestClient.InstrumentsAsync().GetAwaiter().GetResult();

                    break;
                }
                catch (Exception exception)
                {
                    _log.Info("Exception occured while getting instruments via REST.", exception);
                }
            }

            foreach (var instrument in instruments)
            {
                var withoutSpotSuffix = InstrumentWoSuffix(instrument.Name);
                _withWithoutSuffixMapping[instrument.Name]   = withoutSpotSuffix;
                _withoutWithSuffixMapping[withoutSpotSuffix] = instrument.Name;
            }

            _log.Info("Finished instrument initialization.", new { instruments.Count });
        }