1. Learn
  2. /
  3. Courses
  4. /
  5. Introduction to Testing in Java

Connected

Exercise

CsvSource: Digits

You've revisited the lastDigit() from Chapter 1, and this time you've prepared for negative values using Math.abs(). Now that you know you can condense tests using @ParameterizedTest, you've attempted to test all outcomes of lastDigit() in one go.

Verify the method returns the correct digit for positive, negative, and zero-ending integers.

Instructions

100 XP
  • Use the annotation for inputting multiple values into a test method.
  • Add the method arguments for the test method.