Skip to content

QuestTest

remmy edited this page Oct 12, 2024 · 1 revision

The QuestTest class verifies the initialization, completion, and failure scenarios for a quest. It checks the quest's name, description, task progression, and updates its status upon completion or failure. Below you can find all the tests and setup for this test class.

Testing Plan

Initialisation

private Quest quest;

    @BeforeEach
    void setUp() {
        // Initialize the task with a required number of triggers
        Task stepsTask = new Task("steps", "Take your first steps", "Just start moving!", 5, 0, false, false);

        // Create the quest with the task
        quest = new Quest("First Steps",

                "Take your first steps in this world!",
                List.of(stepsTask),
                false,
                null,
                null,
                true,
                false,
                0,
                null);
    }

Tests

  • basicQuestCompletion(): Tests the quest's completion process by simulating progression of the quest.

  • basicQuestFailure(): Verifies the quest failure process.

Clone this wiki locally