package thb.jeanluc.adventure.loader;

import org.junit.jupiter.api.Test;
import thb.jeanluc.adventure.loader.dto.RoomDto;
import thb.jeanluc.adventure.model.Room;

import java.util.List;
import java.util.Map;

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

class RoomMusicTest {

    @Test
    void musicFieldIsCarriedOntoRoom() {
        RoomDto dto = new RoomDto("r", "Room", "d",
                Map.of(), List.of(), List.of(), null, null, null, "theme.ogg");
        Room room = RoomFactory.shellFromDto(dto);
        assertThat(room.getMusic()).isEqualTo("theme.ogg");
    }

    @Test
    void absentMusicIsNull() {
        RoomDto dto = new RoomDto("r", "Room", "d", Map.of(), List.of(), List.of());
        Room room = RoomFactory.shellFromDto(dto);
        assertThat(room.getMusic()).isNull();
    }
}
