コード例 #1
0
ファイル: PlaceOrderTest.cs プロジェクト: dreamsql/Outter
        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);
        }
コード例 #2
0
ファイル: PlaceOrderTest.cs プロジェクト: dreamsql/Outter
        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);
        }
コード例 #3
0
 internal void AddOrder(FakeOrder order, OperationType operationType)
 {
     _orders.AddItem(order, operationType);
 }
コード例 #4
0
 internal void RemoveOrder(FakeOrder order)
 {
     order.ChangeToDeleted();
     order.Phase = OrderPhase.Deleted;
     _orders.RemoveItem(order);
 }