Exemplo n.º 1
0
        public void PaymentExeptciotn()
        {
            User        user = new User("MAre", "Care", 0, 40, false);
            UserBanking bank = new UserBanking();

            Assert.Throws <Exception>(() => bank.Payment(user, 0));
        }
Exemplo n.º 2
0
 private void btnCheck_Click(object sender, EventArgs e)
 {
     if (rbtnPayment.Checked)
     {
         UserBanking banking = new UserBanking();
         banking.Payment(user, decimal.Parse(tbxInput.Text));
         tbxOutput.Text = "Payment was successfully made!";
     }
     else if (rbtnTransfer.Checked)
     {
         UserBanking banking = new UserBanking();
         if (banking.Transfer(user, decimal.Parse(tbxInput.Text)))
         {
             tbxOutput.Text = "Transfer was successfully done!";
         }
         else
         {
             tbxOutput.Text = "You don't have enough money on your account!";
         }
     }
     else if (rbtnCredit.Checked)
     {
         UserBanking banking = new UserBanking();
         if (banking.Credit(user, decimal.Parse(tbxInput.Text), dtpDate.Value))
         {
             Console.WriteLine(dtpDate.Value);
             tbxOutput.Text = "Credit has been successfully approved!";
         }
         else
         {
             Console.WriteLine(dtpDate.Value);
             tbxOutput.Text = "Credit request has been rejected!";
         }
     }
 }
Exemplo n.º 3
0
        public void Payment_Success()
        {
            User        user = new User("Pera", "Peric", 500, 0, false);
            UserBanking bank = new UserBanking();

            bank.Payment(user, 500);
            Assert.AreEqual(500, user.balance);
        }