Return Method Tests
Example 1 - Add Five
Grading Tests:
import org.junit.Test;
import static org.junit.Assert.*;
public class CodingRoomsUnitTests {
@Test
public void testDefaultCase() {
// You may rename this method to better suit the purpose of your test case
// Your test case logic here
assertEquals(10, Example1.addFive(5));
assertEquals(5, Example1.addFive(0));
assertEquals(11, Example1.addFive(6));
}
}Sample Solution:
Example 2 - Average
Grading Tests:
Sample Solution:
Example 3 - Repeats
Grading Tests:
Sample Solution:
Last updated
Was this helpful?