public override void StateChangeCheck(BankAccount bankAccount)
 {
     if (bankAccount.Balance < this.LowerLimit)
     {
         bankAccount.AccountStateId = GoldState.GetInstance().AccountStateId;
     }
 }
Example #2
0
 /// <summary>
 /// Checks if the balance is less than the lower limit - If so, change the state to Gold
 /// </summary>
 /// <param name="bankAccount">Evaluates the bankAccount.Balance</param>
 public override void StateChangeCheck(BankAccount bankAccount)
 {
     if (!bankAccount.Description.Equals("Mortgage"))
     {
         if (bankAccount.Balance < LOWER_LIMIT)
         {
             bankAccount.AccountStateId = GoldState.GetInstance().AccountStateId;
         }
     }
 }
 /// <summary>
 /// Checks the current state and matches it with silverste requiremnets
 /// </summary>
 /// <param name="bankAccount"></param>
 public override void StateChangeCheck(BankAccount bankAccount)
 {
     //Checks if balance is lower than the lower limit
     if (bankAccount.Balance < LowerLimit)
     {
         bankAccount.AccountStateId = BronzeState.GetInstance().AccountStateId;
     }
     //Checks if balance is more than upper limit
     if (bankAccount.Balance > this.UpperLimit)
     {
         bankAccount.AccountStateId = GoldState.GetInstance().AccountStateId;
     }
 }