public void DataPushRequestIsForwardedToLocalStorage() { var instrument = new Instrument { ID = 1, Symbol = "SPY", Datasource = new Datasource { ID = 1, Name = "MockSource" } }; var data = new List<OHLCBar> { new OHLCBar {Open = 1, High = 2, Low = 3, Close = 4, DT = new DateTime(2013, 1, 1) } }; var req = new DataAdditionRequest(BarSize.OneDay, instrument, data, true); _client.PushData(req); Thread.Sleep(50); _brokerMock.Verify(x => x.AddData( It.Is<DataAdditionRequest>(y => y.Frequency == BarSize.OneDay && y.Instrument.ID == 1 && y.Data.Count == 1) ), Times.Once); }
public void DataAdditionRequestsAreForwardedToLocalStorage() { var data = new List<OHLCBar> { new OHLCBar {Open = 1, High = 2, Low = 3, Close = 4, DT = new DateTime(2000, 1, 1) } }; var request = new DataAdditionRequest(BarSize.OneDay, _instrument, data, true); _broker.AddData(request); _localStorageMock.Verify(x => x.AddData( It.Is<List<OHLCBar>>(b => b.Count == 1 && b[0].Close == 4), It.Is<Instrument>(i => i.ID == 1 && i.Symbol == "SPY" && i.Datasource.Name == "MockSource"), It.Is<BarSize>(z => z == BarSize.OneDay), It.Is<bool>(k => k == true), It.IsAny<bool>()), Times.Once); }