feat: Ending model + endings.yaml loading (ordered, optional)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
package thb.jeanluc.adventure.loader;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import thb.jeanluc.adventure.loader.dto.ConditionDto;
|
||||
import thb.jeanluc.adventure.loader.dto.EndingDto;
|
||||
import thb.jeanluc.adventure.model.Ending;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
class EndingLoadingTest {
|
||||
@Test
|
||||
void factoryMapsFields() {
|
||||
Ending e = EndingFactory.fromDto(new EndingDto("victory", "Won", true,
|
||||
List.of(new ConditionDto("manor_secured", null, null)), "You win."));
|
||||
assertThat(e.id()).isEqualTo("victory");
|
||||
assertThat(e.victory()).isTrue();
|
||||
assertThat(e.when()).hasSize(1);
|
||||
assertThat(e.text()).isEqualTo("You win.");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user