public void ATMWithdrawShoudWithdrawMoney() { ATMWithdrawal.WithdrawMoney(cardNumber, cardPin, 100M); var testContext = new ATMEntities(); var newCash = testContext.CardAccounts.First(c => c.CardNumber == cardNumber).CardCach; Assert.AreEqual(900M, newCash); }
public void ATMWithdrawShoudCheckIsValidPinNumber() { ATMWithdrawal.WithdrawMoney(cardNumber, cardPin, 0M); int count = context.CardAccounts.Count(c => c.CardNumber == cardNumber && c.CardPIN == cardPin); Assert.IsTrue(count == 1, "There is no card with this PIN!"); }