feat(loader): per-room music field + demo rooms.yaml entries
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user