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
From the course: Practical Test-Driven Development for Java Programmers
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
-
-
-
-
-
(Locked)
Loading up the final case study4m 32s
-
(Locked)
Understanding the project structure8m 18s
-
(Locked)
Understanding the business logic4m 13s
-
(Locked)
Adding Mockito3m 3s
-
(Locked)
Setting up the tests6m 25s
-
(Locked)
The need for spying7m 46s
-
(Locked)
Challenge 61m 15s
-
(Locked)
Walkthrough 6, part 14m 34s
-
(Locked)
Walkthrough 6, part 27m 43s
-
(Locked)