feat: implemented aquiring characters of random order in CharacterConfig
This commit is contained in:
@ -4,9 +4,12 @@ import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import net.jqwik.api.*;
|
||||
import net.jqwik.api.lifecycle.BeforeProperty;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import uulm.teamname.marvelous.gamelibrary.config.CharacterConfig;
|
||||
import uulm.teamname.marvelous.gamelibrary.config.CharacterProperties;
|
||||
import uulm.teamname.marvelous.gamelibrary.json.JSON;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
|
||||
@ -260,6 +263,18 @@ class CharacterConfigJSONTest {
|
||||
}
|
||||
""";
|
||||
|
||||
@Test
|
||||
void disjointSubsetGenerationWorks() {
|
||||
var characterConfig = JSON.parseCharacterConfig(json);
|
||||
System.out.println(characterConfig.get().characters.length);
|
||||
var tuple = characterConfig.get().getDisjointSetsOfPropertiesOfSize(6);
|
||||
assertThat(tuple.item1).doesNotHaveDuplicates().hasSize(6);
|
||||
assertThat(tuple.item2).doesNotHaveDuplicates().hasSize(6);
|
||||
assertThat(tuple.item1)
|
||||
.doesNotContainAnyElementsOf(Arrays.asList(tuple.item2));
|
||||
System.out.println(tuple);
|
||||
}
|
||||
|
||||
ObjectMapper mapper;
|
||||
|
||||
@BeforeProperty
|
||||
|
Reference in New Issue
Block a user