Commit 3a0d3830 authored by Adrien Oliva's avatar Adrien Oliva

test(Quest): Add unit test on Quest

Test Quest class
Signed-off-by: Adrien Oliva's avatarAdrien Oliva <olivaa+gitlab@yapbreak.fr>
parent ea812326
Pipeline #468 passed with stage
in 0 seconds
package fr.yapbreak.skyrimquest;
import org.junit.Test;
import static org.junit.Assert.*;
import fr.yapbreak.skyrimquest.quests.Quest;
import fr.yapbreak.skyrimquest.quests.Status;
public class QuestUnitTest {
@Test
public void default_constructor() {
Quest q = new Quest();
assertEquals("", q.getTitle());
assertEquals("", q.getDescription());
assertEquals(Status.NOT_STARTED, q.getStatus());
}
@Test
public void title_constructor() {
Quest q = new Quest("Test");
assertEquals("Test", q.getTitle());
assertEquals("", q.getDescription());
assertEquals(Status.NOT_STARTED, q.getStatus());
}
@Test
public void titleDesc_constructor() {
Quest q = new Quest("MyQuest", "a description");
assertEquals("MyQuest", q.getTitle());
assertEquals("a description", q.getDescription());
assertEquals(Status.NOT_STARTED, q.getStatus());
}
@Test
public void complete_constructor() {
Quest q = new Quest("A Quest", "my desc", Status.FAILURE);
assertEquals("A Quest", q.getTitle());
assertEquals("my desc", q.getDescription());
assertEquals(Status.FAILURE, q.getStatus());
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment