-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
68 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package model; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
public class MissionTest { | ||
|
||
@Test | ||
public void testGetters() { | ||
Mission mission = new Mission(1, "Test Mission", "Test Description", "2023-01-01 18:00:00", 2, "Pending", 3); | ||
|
||
assertEquals(1, mission.getIdMission()); | ||
assertEquals("Test Mission", mission.getTitle()); | ||
assertEquals("Test Description", mission.getDescription()); | ||
assertEquals("2023-01-01 18:00:00", mission.getDateTime()); | ||
assertEquals(2, mission.getIdNeeder()); | ||
assertEquals("Pending", mission.getStatus().name()); | ||
assertEquals(3, mission.getIdHelper()); | ||
} | ||
|
||
@Test | ||
public void testMissionConstructor() { | ||
Mission mission = new Mission(1, "Test Mission", "Test Description", "2023-01-01 18:00:00", 2, "Pending", 3); | ||
|
||
assertEquals(1, mission.getIdMission()); | ||
assertEquals("Test Mission", mission.getTitle()); | ||
assertEquals("Test Description", mission.getDescription()); | ||
assertEquals("2023-01-01 18:00:00", mission.getDateTime()); | ||
assertEquals(2, mission.getIdNeeder()); | ||
assertEquals("Pending", mission.getStatus().name()); | ||
assertEquals(3, mission.getIdHelper()); | ||
} | ||
|
||
@Test | ||
public void testToString() { | ||
Mission mission = new Mission(1, "Test Mission", "Test Description", "2023-01-01 18:00:00", 2, "Pending", 3); | ||
|
||
String expectedToString = "Mission{idMission=1, title='Test Mission', description='Test Description', date='2023-01-01 18:00:00', idNeeder=2, idHelper=3, status=Pending}"; | ||
assertEquals(expectedToString, mission.toString()); | ||
} | ||
|
||
} |