package thb.jeanluc.adventure.game;

import org.junit.jupiter.api.Test;
import static org.assertj.core.api.Assertions.assertThat;

class QuestLogTest {
    @Test
    void startAdvanceComplete() {
        QuestLog log = new QuestLog();
        assertThat(log.isActive("q")).isFalse();
        log.start("q");
        assertThat(log.isActive("q")).isTrue();
        assertThat(log.stageIndex("q")).isEqualTo(0);
        log.advance("q");
        assertThat(log.stageIndex("q")).isEqualTo(1);
        log.complete("q");
        assertThat(log.isActive("q")).isFalse();
        assertThat(log.isCompleted("q")).isTrue();
    }

    @Test
    void startIgnoredOnceCompleted() {
        QuestLog log = new QuestLog();
        log.start("q");
        log.complete("q");
        log.start("q");
        assertThat(log.isActive("q")).isFalse();
        assertThat(log.isCompleted("q")).isTrue();
    }
}
