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.

Challenge 4 and walkthrough 4

Challenge 4 and walkthrough 4

- [Instructor] Okay, well there's on final piece of functionality, I want to cover in this chapter, and I did promise you at the start that there would be opportunities for you to work through the three stage process of red, green refactor. So we'll do this last piece of functionality in that way. I'm going to give you some suggestions. I suggest that you pause the video, have a go at it, each step by step, looking at what I'm doing as you go. So this last piece of business logic is dealing with 13-digit ISBN numbers. Right now, we're only dealing with 10-digit ISBNs, but they could also be 13-digits long. So pause the video now, and let's write a test to validate a 13-digit ISBN number. I'll let you go find any valid ISBN number, just search for your favorite book on Amazon and scroll down to find the ISBN number, but I suggest we start with making sure it's one that doesn't end in an X. Just pick any standard 13-digit ISBN number. Okay, well I hope you have had a go at writing that…

Contents