Complete the code to assert that the sum of 2 and 3 equals 5.
assertEquals([1], 2 + 3);
The assertion checks if 2 + 3 equals 5, which is true.
Complete the code to assert that a string is not null.
assertNotNull([1]);The assertion checks that the variable someString is not null.
Fix the error in the assertion that checks if two objects are equal.
assertEquals([1], expectedObject, actualObject);The first argument is an optional message string. The correct order is assertEquals(message, expected, actual).
Fill both blanks to create a test that asserts a list contains exactly 3 elements and is not empty.
assertEquals([1], myList.size()); assertFalse([2]);
The first assertion checks the list size is 3. The second asserts the list is not empty by checking myList.isEmpty() is false.
Fill all three blanks to write a test that asserts a string is not null, contains 'test', and has length 4.
assertNotNull([1]); assertTrue([2]); assertEquals([3], [1].length());
The test checks that inputString is not null, contains the substring 'test', and its length is 4.