public void DepositNoAccountNumberReturnsFalse() { var account = new Mock <IAccount>(); account.Setup(x => x.balance).Returns(999.0); AccountActions actions = new AccountActions(); Assert.IsFalse(actions.Deposit(account.Object, 10.05)); }
public void DepositPositiveAmountReturnsTrue() { var account = new Mock <IAccount>(); account.Setup(x => x.balance).Returns(999.00); account.Setup(x => x.number).Returns("00001234"); AccountActions actions = new AccountActions(); Assert.IsTrue(actions.Deposit(account.Object, 10.05)); }
public void DepositPositiveAmountBalanceUpdated() { var account = new Mock <IAccount>(); account.SetupProperty(x => x.balance); account.Object.balance = 999.00; account.Setup(x => x.number).Returns("00001234"); AccountActions actions = new AccountActions(); actions.Deposit(account.Object, 10.05); Assert.AreEqual(999.0 + 10.05, account.Object.balance); }