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

Connected

Exercise

Digits of a number fail

Now that you've written a successful test, write a test that will fail when it encounters unexpected behavior at an edge case.

Software engineers often intentionally write failing tests to demonstrate the existence of a bug.

The necessary JUnit packages have been imported for you.

Instructions

100 XP
  • Enter the correct annotation that will enable JUnit to execute this test.
  • Call the method under test.
  • Use the correct JUnit assertion to assert expected behavior - the test fails.