예제 #1
0
        public void CreateComplexTransactionTest()
        {
            var newTransaction = storage.CreateTransaction(transaction);

            storage.AddChildTransaction(newTransaction, storage.CreateTransaction(childTransaction));
            storage.AddChildTransaction(newTransaction, storage.CreateTransaction(childTransaction1));


            var complexTransaction = storage.GetAllTransactions().FirstOrDefault(x => x.IsComplexTransaction);

            Assert.AreEqual(transaction.Name, complexTransaction?.Name);
            Assert.AreEqual(transaction.Category.Id, complexTransaction?.Category?.Id);
            Assert.AreEqual(transaction.Account.Id, complexTransaction?.Account?.Id);
            Assert.AreEqual(426.00m, complexTransaction?.Total);
        }
예제 #2
0
 public void AddChildTransaction(ITransaction parent, ITransaction child)
 {
     _storage.AddChildTransaction(parent, child);
     _isDirty = true;
 }