package thb.jeanluc.adventure.model;

import org.junit.jupiter.api.Test;
import thb.jeanluc.adventure.model.item.Item;
import thb.jeanluc.adventure.model.item.PlainItem;

import static org.assertj.core.api.Assertions.assertThat;

class NpcTest {

    @Test
    void shell_isMutableForReactions() {
        Npc man = Npc.shell("man", "Man", "d", "hi");
        Item lamp = PlainItem.builder().id("lamp").name("Lamp").description("d").build();

        man.putReaction("lamp", NpcReaction.builder()
                .consumes(lamp).response("thanks").build());

        assertThat(man.reactionFor("lamp")).isPresent();
        assertThat(man.reactionFor("nope")).isEmpty();
    }
}
