示例#1
0
        public void OneBuyLotsOfPotentialSellsOrderTest()
        {
            ulong buyQuantity = m_BuyOrder.Quantity;

            m_SellOrders.Insert(new EquityOrder(m_Instrument, Order.OrderTypes.GoodUntilCancelled, Order.BuyOrSell.Sell, 95, 100));
            m_SellOrders.Insert(new EquityOrder(m_Instrument, Order.OrderTypes.GoodUntilCancelled, Order.BuyOrSell.Sell, 95, 100));

            Assert.True(OrderProcessor.TryMatchOrder(m_BuyOrder, m_SellOrders, m_Trades));
            Trade trade = m_TradeProcessor.Trades[0];

            Assert.That(m_TradeProcessor.Trades.Count, Is.EqualTo(1));

            Assert.That(trade.Instrument, Is.EqualTo(m_Instrument));
            Assert.That(trade.Price, Is.EqualTo(m_SellOrder.Price));
            Assert.That(trade.Quantity, Is.EqualTo(buyQuantity));

            Assert.That(m_SellOrders.Count() == 2);
            Assert.That(!m_SellOrders.Contains(m_SellOrder));
        }