public void ObserveInstrumentPrices(IEnumerable <InstrumentPrice> prices, IEnumerable <InstrumentPrice> expectedPrices, CachingInstrumentPriceService service) { var result = new List <InstrumentPrice>(); ("Given the prices " + prices.ToSummary()) .f(() => { }); "And the service" .f(() => service = new CachingInstrumentPriceService(prices.ToObservable(), ImmediateScheduler.Instance, 1)); "When ObserveInstrumentPrices() is called" .f(() => service.ObserveInstrumentPrices().Subscribe(p => result.Add(p))); ("Then the received prices are " + expectedPrices.ToSummary()) .f(() => Assert.Equal(expectedPrices, result)); }
public void Initialize() { var instrumentPriceService = new CachingInstrumentPriceService(_prices, TaskPoolScheduler.Default); _container.RegisterInstance <IInstrumentPriceService>(instrumentPriceService); }