public void TestCantClosePositionBeforeOpening() { var position = new LongPosition(); var order = GetOrderInfo(new SOrderParameters(EOrderAction.Sell)); Assert.Throws <InvalidOrderException>(() => position.ValidateOrder(order)); }
public void TestSize() { var position = new LongPosition(); position.UpdatePosition(GetOrderInfo(new SOrderParameters(EOrderAction.Buy))); Assert.Equal(100, position.Size); }
public void TestSizeNoPositions() { var position = new LongPosition(); Assert.Equal(0, position.Size); }