/// <summary> /// Validate Bank Card Enterred /// </summary> /// <param name="card"></param> /// <returns></returns> public bool Authenticate(BankCard card) { ValidBankAccount = _cardRepository.ToList().SingleOrDefault(_ => _.CardId == card.CardId && _.PIN == card.PIN); if (ValidBankAccount != null) { return(true); } else { return(false); } }
private bool UpdateCardData(BankCard card) { _cardRepository.Remove(card); _cardRepository.Add(card); return(true); }
public ATMManager(BankCard enterredCard, IEnumerable <BankCard> cardRepository) { _cardRepository = cardRepository.ToList(); _authenticator = new CardAuthenticator(cardRepository); IsAuthenticated = _authenticator.Authenticate(enterredCard); }