Пример #1
0
        public void CanReceivePriceTest()
        {
            
            var mockService = new MockPriceService();
            var viewModel = new PriceUpdateViewModel(mockService);
            //viewModel.RefreshRate = 150;
            viewModel.StartCommand.Execute(null);
            T.Thread.Sleep(1000);
            viewModel.StopCommand.Execute(null);

            var p_service = mockService.CurrentPrices;

            //T.Thread.Sleep(160);
            var p_ui = viewModel.LastestPrices;

            var i = 0;
            foreach(var p in p_ui)
            {
                Assert.AreEqual(p_service[i].AskPx, p.AskPx);
                Assert.AreEqual(p_service[i].AskQty, p.AskQty);
                Assert.AreEqual(p_service[i].BidPx, p.BidPx);
                Assert.AreEqual(p_service[i].BidQty, p.BidQty);
                Assert.AreEqual(p_service[i].Volume, p.Volume);
                i++;
            }
        }
Пример #2
0
 public PriceUpdateView()
 {
     InitializeComponent();
     _viewModel = new PriceUpdateViewModel(new RandomWalkPriceService());
     DataContext = _viewModel;
 }