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

Unlock this course with a free trial

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

Finishing the business requirements

Finishing the business requirements

- [Instructor] Now I'd like the next thing to do to be to check an invalid 13 digit ISBN. But before we do that I think it's time for a bit of a refactor, and what we've got now are test methods called checkAValidISBN and checkAValid13DigitISBN so I think it makes sense to rename this method to checkAValid10DigitISBN and while we're there are there any others that we should rename? Well yes we've got here checkAnInvalid, let's make that 10DigitISBN. ISBNNumbersEndingInAnXAreValid, I think that should be TenDigitISBNNumbersEndingInAnXAreValid I'm not sure about 13 digit ISBN numbers whether they can end in an X or not just yet and we've got down here nineDigitISBNsAreNotAllowed that's fine, and nonNumericISBNsAreNotAllowed. I think that's okay as well. You might choose to put in here another example of a 13 character string which is non-numeric I'll leave you to do that if you want to. Okay, so let's have a go then at the next test which is going to be for an invalid ISBN number that…

Contents