package thb.jeanluc.adventure.io.text;

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

class MapViewTest {
    @Test
    void mapViewIsImmutableAndHoldsCellsAndConnections() {
        RoomCell a = new RoomCell("kitchen", "Kitchen", 0, 0, CellState.CURRENT);
        RoomCell b = new RoomCell("hallway", "Hallway", 0, -1, CellState.VISITED);
        MapView v = new MapView(List.of(a, b), List.of(new Connection(a, b)));
        assertThat(v.cells()).hasSize(2);
        assertThat(v.connections()).hasSize(1);
        assertThat(v.connections().getFirst().from().id()).isEqualTo("kitchen");
    }
}
