Beispiel #1
0
        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));
        }
Beispiel #2
0
        public void Initialize()
        {
            var instrumentPriceService = new CachingInstrumentPriceService(_prices, TaskPoolScheduler.Default);

            _container.RegisterInstance <IInstrumentPriceService>(instrumentPriceService);
        }