package thb.jeanluc.adventure.command.impl;

import org.junit.jupiter.api.Test;

import java.util.List;

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

class LookCommandTest {

    @Test
    void look_writesNameDescriptionItemsNpcsAndExits() {
        CommandTestSupport.World w = new CommandTestSupport.World();

        new LookCommand().execute(w.ctx, List.of());

        String text = w.io.lastOutput();
        assertThat(text).contains("Kitchen");
        assertThat(text).contains("kitchen desc");
        assertThat(text).contains("Lamp").contains("Letter");
        assertThat(text).contains("Old Man");
        assertThat(text).contains("north");
    }

    @Test
    void look_noItemsNoNpcs_stillWorks() {
        CommandTestSupport.World w = new CommandTestSupport.World();
        w.player.setCurrentRoom(w.hallway);

        new LookCommand().execute(w.ctx, List.of());

        String text = w.io.lastOutput();
        assertThat(text).contains("Hallway");
        assertThat(text).contains("south");
        assertThat(text).doesNotContain("You see");
    }
}
