From the course: Practical Test-Driven Development for Java Programmers

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

Walkthrough 6, part 2

Walkthrough 6, part 2

- [Instructor] So we want to write the second test now. I'm just going to copy and paste this. And the second test is going to be the same principle, the same interest rate, but this time, it's over 24 months and we expect the repayment to be 60. So we'll change our term to 24. We expect the repayment to be 60. But before we run this, because it's a new test method, I'm definitely going to put in a call to the fail to make sure whatever happens, it fails. We should rename this to Test2YearLoan with WholePounds. I think that was the name that we used. And let's run this test method and check that we get a red bar. We do, so that's good, so I can remove the call to fail. But actually, I can see that this method failed anyway. We've got an expectation of 60, but actually, the value we got here was 110. Let's just rerun that and check that is definitely what was going on. Yes, so we've got an error in our logic. Well, I've got on screen here, the calculation from that PDF file that was…

Contents