Tests for random seed serialization

This commit is contained in:
Collin Smith 2021-07-24 00:57:54 -07:00
parent 983552fe01
commit 9db87b166e

View File

@ -0,0 +1,18 @@
package com.riiablo.map2.random;
import org.junit.jupiter.api.*;
import static org.junit.jupiter.api.Assertions.*;
import com.badlogic.gdx.math.MathUtils;
class SeedTest {
@RepeatedTest(10)
void encode() {
long seed0 = MathUtils.random.nextLong();
long seed1 = MathUtils.random.nextLong();
String encoding = Seed.encode(seed0, seed1);
Seed seed = Seed.decode(encoding);
assertEquals(seed0, seed.seed0);
assertEquals(seed1, seed.seed1);
}
}