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 InventoryCommandTest {

    @Test
    void empty_writesEmptyMessage() {
        CommandTestSupport.World w = new CommandTestSupport.World();
        new InventoryCommand().execute(w.ctx, List.of());
        assertThat(w.io.lastOutput()).contains("not carrying");
    }

    @Test
    void withItems_listsByName() {
        CommandTestSupport.World w = new CommandTestSupport.World();
        new TakeCommand().execute(w.ctx, List.of("letter"));
        new TakeCommand().execute(w.ctx, List.of("lamp"));

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

        assertThat(w.io.lastOutput()).contains("Letter").contains("Lamp");
    }
}
