Skip to content

Instantly share code, notes, and snippets.

@smith558
Last active November 30, 2020 22:09
Show Gist options
  • Save smith558/f366bd037b2dc469edee70db9ba36968 to your computer and use it in GitHub Desktop.
Save smith558/f366bd037b2dc469edee70db9ba36968 to your computer and use it in GitHub Desktop.
An erroneous test case in TestPart2.java?
/**
* Test {@link SEStudent#groupWork(Character)}.
*/
@Test
@DisplayName("Test SEStudent's groupWork(Character)")
public void testSEStudent_groupWork() {
student.selfStudy();
student.selfStudy();
student.selfStudy();
student.selfStudy();
student.selfStudy();
assertEquals(18, student.getHP(), "Incorrect HP for SEStudent before using group work");
assertEquals(11, student.getAttack(), "Incorrect Attack for SEStudent before using group work");
assertEquals(18, student.getEP(), "Incorrect EP for SEStudent before using group work");
try {
student.groupWork(enemy2);
assertEquals(22, student.getEP(), "Incorrect EP for Student after using group work");
assertEquals(2, enemy2.getHP(), "Incorrect HP for Enemy2 after group work attack by Student");
} catch (Exception e) {
fail(" Students should have sufficient KPs");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment