Пример #1
0
        public void CanGetPriceAndVolumeFromMarketFeed()
        {
            using (var marketFeed = new TestableMarketFeedService(new MockPriceUpdatedEventAggregator()))
            {
                marketFeed.TestUpdatePrice("STOCK0", 40.00m, 1234);

                Assert.AreEqual <decimal>(40.00m, marketFeed.GetPrice("STOCK0"));
                Assert.AreEqual <long>(1234, marketFeed.GetVolume("STOCK0"));
            }
        }
Пример #2
0
        public void ShouldPublishUpdatedOnSinglePriceChange()
        {
            var eventAggregator = new MockPriceUpdatedEventAggregator();

            using (TestableMarketFeedService marketFeed = new TestableMarketFeedService(eventAggregator))
            {
                marketFeed.TestUpdatePrice("STOCK0", 30.00m, 1000);
            }

            Assert.IsTrue(eventAggregator.MockMarketPriceUpdatedEvent.PublishCalled);
        }