public Transaction(OrderBL buyOrder, OrderBL sellOrder, string ticker, int quantity, decimal price) { // TODO: Precondtions base.TransactionId = Guid.NewGuid(); base.CreatedTimestamp = Now; base.BuyOrder = buyOrder; base.SellOrder = sellOrder; base.Ticker = ticker; base.Quantity = quantity; base.Price = price; }
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); }