Ejemplo n.º 1
0
        public void AccountPayment_InvalidTest()
        {
            FinanceManager financeManager = new FinanceManager();

            FinantialDB.Accounts.Clear();
            financeManager.CreateAccount("412341234", new Bank(), 34534, 600, true);
            IAccount account = FinantialDB.Accounts.Values.ToList()[0];

            double oldBalance = account.Balance;

            Assert.Throws <KeyNotFoundException>(() => financeManager.AccountPayment(Guid.NewGuid(), 100));
        }
Ejemplo n.º 2
0
        public void AccountPayment_ValidTest()
        {
            FinanceManager financeManager = new FinanceManager();

            FinantialDB.Accounts.Clear();
            financeManager.CreateAccount("412341234", new Bank(), 34534, 600, true);
            IAccount account = FinantialDB.Accounts.Values.ToList()[0];

            double oldBalance = account.Balance;

            financeManager.AccountPayment(account.ID, 100);

            Assert.IsTrue(account.Balance == oldBalance + 100);
        }