public void DeleteTransactionTest() { var factory = new RegularQuickTransactionFactory(); var storage = new MemoryQuickTransactionStorage(factory); var transaction = CreateTransaction(); storage.CreateQuickTransaction(transaction); var numberOfTransactionsAfterCreate = storage.GetAllQuickTransactions().Count(); storage.DeleteQuickTransaction(transaction); var numberOfTransactions = storage.GetAllQuickTransactions().Count(); Assert.AreEqual(0, numberOfTransactions); Assert.AreEqual(1, numberOfTransactionsAfterCreate); }
public void UpdateTransactionTest() { var factory = new RegularQuickTransactionFactory(); var storage = new MemoryQuickTransactionStorage(factory); var transaction = CreateTransaction(); storage.CreateQuickTransaction(transaction); transaction.Total = 120; storage.UpdateQuickTransaction(transaction); var storedTransaction = storage.GetAllQuickTransactions().First(); Assert.AreEqual(transaction.Total, storedTransaction.Total); }
public void GetAllTransactionsTest() { var factory = new RegularQuickTransactionFactory(); var storage = new MemoryQuickTransactionStorage(factory); var transaction = CreateTransaction(); storage.CreateQuickTransaction(transaction); var newTransaction = storage.GetAllQuickTransactions().First(); Assert.AreEqual(transaction.Account, newTransaction.Account); Assert.AreEqual(transaction.Category, newTransaction.Category); Assert.AreEqual("Simple Transaction", newTransaction.Name); Assert.AreEqual(100m, newTransaction.Total); Assert.AreEqual(5, newTransaction.Id); Assert.AreEqual(0, newTransaction.Weight); Assert.AreEqual(false, newTransaction.AskForTotal); Assert.AreEqual(false, newTransaction.AskForWeight); }