Search the courses, subjects, tracks, games and features, or jump straight to a page.
4 cards from this section. Quick, good the night before a test.
What does the method assertEquals do?
Think about what you compare in your tests.
Write an assertion to check if a variable x is equal to 10.
Use assertEquals with expected value first.
What method do you use to check if two values are equal?
Think about the naming convention for checks.
True or False: assertTrue checks if a condition is false.
Remember what assertTrue signifies.
Write a unit test that uses assertEquals to compare two calculated values potentially returned from methods.
Think about what you expect from the calculations.
How would you structure a test using assertThrows to ensure a method throws an exception for invalid input?
Consider how your method handles invalid data.
6 more questions in this section. Enroll free to practise them all.
Enroll free