public void CalcInterestIfAmountOver500() { var calculator = new TesterInterestCalculator(); calculator.Principal = 500.01; calculator.InterestRate = 0.05; calculator.Time = 2; var bank = new Bank(calculator); bank.RunProcessing(); Assert.IsTrue(calculator.CalculateWasCalled); }
public void DontCalcInterestIfAmountLessThan500() { var calculator = new TesterInterestCalculator(); calculator.Principal = 499.99; calculator.InterestRate = 0.05; calculator.Time = 2; var bank = new Bank(calculator); bank.RunProcessing(); Assert.IsFalse(calculator.CalculateWasCalled); }
public void MockDontCalcInterestIfAmountLessThan500() { var calculator = MockRepository.GenerateMock<SimpleInterestCalculator>(); calculator.Principal = 499.99; calculator.InterestRate = 0.05; calculator.Time = 2; var bank = new Bank(calculator); bank.RunProcessing(); calculator.AssertWasNotCalled(c => c.CalculateInterestAmount()); }