public void RejectTestWithAsNewRecord() { FakeAccount account = new FakeAccount(Guid.NewGuid(), "Acc4"); Debug.WriteLine(account.SaveChanges()); Assert.AreEqual(0, account.TransactionCount); FakeTransaction tran1 = new FakeTransaction(Guid.NewGuid(), "tran1", account, OperationType.AsNewRecord); FakeOrder order1 = new FakeOrder(tran1, Guid.NewGuid(), "order1", 2, 2); account.RejectChanges(); Assert.AreEqual(0, account.TransactionCount); }
public void DeleteOrderTest() { FakeAccount account = new FakeAccount(Guid.NewGuid(), "Acc2"); FakeTransaction tran1 = new FakeTransaction(Guid.NewGuid(), "tran1", account); FakeOrder order1 = new FakeOrder(tran1, Guid.NewGuid(), "order1", 2, 2); FakeTransaction tran2 = new FakeTransaction(Guid.NewGuid(), "tran2", account); FakeOrder order2 = new FakeOrder(tran2, Guid.NewGuid(), "order2", 3, 3); Assert.AreEqual(2, account.TransactionCount); Assert.AreEqual(1, tran2.OrderCount); order1.LotBalance = 1; tran2.RemoveOrder(order2); Debug.WriteLine(account.SaveChanges()); Assert.AreEqual(0, tran2.OrderCount); account.RemoveTran(tran2); Assert.AreEqual(2, account.TransactionCount); Debug.WriteLine(account.SaveChanges()); Assert.AreEqual(1, account.TransactionCount); }
internal void AddOrder(FakeOrder order, OperationType operationType) { _orders.AddItem(order, operationType); }
internal void RemoveOrder(FakeOrder order) { order.ChangeToDeleted(); order.Phase = OrderPhase.Deleted; _orders.RemoveItem(order); }