示例#1
0
        public void TestCantClosePositionBeforeOpening()
        {
            var position = new LongPosition();
            var order    = GetOrderInfo(new SOrderParameters(EOrderAction.Sell));

            Assert.Throws <InvalidOrderException>(() => position.ValidateOrder(order));
        }
示例#2
0
        public void TestSize()
        {
            var position = new LongPosition();

            position.UpdatePosition(GetOrderInfo(new SOrderParameters(EOrderAction.Buy)));
            Assert.Equal(100, position.Size);
        }
示例#3
0
        public void TestSizeNoPositions()
        {
            var position = new LongPosition();

            Assert.Equal(0, position.Size);
        }