public void Setup() { accountStorage = new CachedAccountStorage(new SqLiteAccountStorage(new RegularAccountFactory())); categoryStorage = new CachedCategoryStorage(new SqLiteCategoryStorage(new RegularCategoryFactory())); transactionFactory = new RegularTransactionFactory(); storage = new CachedTransactionStorage(new SqLiteTransactionStorage(transactionFactory, accountStorage, categoryStorage)); categoryStorage.DeleteAllData(); accountStorage.DeleteAllData(); storage.DeleteAllData(); transaction = CreateTransaction(accountStorage, categoryStorage, transactionFactory); childTransaction = CreateTransaction(accountStorage, categoryStorage, transactionFactory); childTransaction1 = CreateTransaction(accountStorage, categoryStorage, transactionFactory); }
public void Setup() { var accountFactory = new RegularAccountFactory(); var categoryFactory = new RegularCategoryFactory(); _accountStorage = new CachedAccountStorage(new SqLiteAccountStorage(accountFactory)); _categoryStorage = new CachedCategoryStorage(new SqLiteCategoryStorage(categoryFactory)); var transactionFactory = new RegularTransactionFactory(); _storage = new CachedTransactionStorage(new SqLiteTransactionStorage(transactionFactory, _accountStorage, _categoryStorage)); _storage.DeleteAllData(); CreateTransaction(); }
public void CreateBarCodeBasedTransactionText() { _storage.DeleteAllData(); _transactionStorage.DeleteAllData(); var account = _accountStorage.CreateAccount("Account", "Description", "UAH"); var category = _categoryStorage.CreateCategory("Category", "category Description", 0, null); var transaction = _transactionStorage.CreateTransaction(account, category, "test", 26.38m, DateTime.Now, 0, 0, null, null); var barCode = _storage.CreateBarCode(CreateBarCode("2734336010584", true, 6)); barCode.Transaction = transaction; _storage.UpdateBarCode(barCode); _storage.CreateBarCode(CreateBarCode("5060207697224")); _storage.CreateTransactionBarCodeRelatedFromStorage("2734336"); var transactions = _transactionStorage.GetAllTransactions(); Assert.AreEqual(2, transactions.Count()); }
public void DeleteAllData() { _storage.DeleteAllData(); _isDirty = true; }