Ejemplo n.º 1
0
        public void CancelTest()
        {
            Guid    orderId = Guid.NewGuid();
            OrderBL order   = new TestOrder {
                OrderId = orderId.ToString(),
                Status  = OrderStatus.OrderCompleted
            };
            Exception e = Assert.Throws <ArgumentException>(() =>
                                                            order.Cancel());

            Assert.Equal("Error Cancel: Status is not Open OrderId: " + orderId.ToString(),
                         e.Message);
            OrderBL open = TestUtils.NewBuyLimitDayOrder();

            Assert.Equal(0, open.CanceledTimestamp);
            open.Cancel();
            Assert.Equal(OrderStatus.OrderCancelled, open.Status);
            Assert.NotEqual(0, open.CanceledTimestamp);
        }