Exemple #1
0
        public async void Remove()
        {
            if (CurrentTransaction != null)
            {
                TransactionsHandler handler = new TransactionsHandler();
                handler.Filename = @"../../../DataBase/Transaction/transactions.json";
                await handler.Remove(_currentTransaction.Transaction.Guid);

                CurrentInfo.Wallet.RemoveTransaction(_currentTransaction.Transaction);
                Transactions.Remove(_currentTransaction);

                CurrentTransaction = null;
            }
        }
Exemple #2
0
        public void TestRemovingTransactions()
        {
            //
            var categoriesTest = new Category("one", "", "", "");
            var guiTest        = Guid.NewGuid();

            //
            TransactionsHandler handler = new TransactionsHandler();

            handler.Filename = @"../../../DataBase/Transaction/transactions.json";
            handler.write(new DBTransaction(guiTest, "", 0, DateTime.Now, "UAH", ""));
            handler.Remove(guiTest);

            ////
            var ex = Assert.Throws <AggregateException>(() => handler.Find(guiTest).Result);

            Assert.NotNull(ex);
        }