private void LoadPositions() { _positions = _spotService.GetSymbols() .ToDictionary(symbol => symbol, symbol => new List <PositionItem>()); var generator = new Random(); var symbolsCount = _spotService.GetSymbols().Count; var prices = _spotService.GetPrices(); for (var i = 0; i < _settings.PositionsCount; i++) { var position = new PositionItem { PositionId = i + 1, Symbol = (Symbol)generator.Next(symbolsCount), Quantity = generator.Next(_settings.MinimumQuantity, _settings.MaximumQuantity) }; position.UpdateSpot(prices[position.Symbol]); _positions[position.Symbol].Add(position); } }
public void SpotService_Returns_All_Symbols() { var count = Enum.GetValues(typeof(Symbol)).Length; _service.GetSymbols().Count.Should().Be(count); }