diff options
author | Joffrey Bion <joffrey.bion@booking.com> | 2020-05-28 20:26:29 +0200 |
---|---|---|
committer | Joffrey Bion <joffrey.bion@booking.com> | 2020-05-31 11:16:00 +0200 |
commit | 36103b92ce4b6cd00925d861f4fb5e381cdc4833 (patch) | |
tree | 4c2bfced8317526b24da23fcef9febe6368c736e /sw-common-model/src/commonTest/kotlin/org/luxons | |
parent | Attempt at fixing race conditions with bot subscriptions (diff) | |
download | seven-wonders-36103b92ce4b6cd00925d861f4fb5e381cdc4833.tar.gz seven-wonders-36103b92ce4b6cd00925d861f4fb5e381cdc4833.tar.bz2 seven-wonders-36103b92ce4b6cd00925d861f4fb5e381cdc4833.zip |
Simplify settings and allow choosing wonders
Diffstat (limited to 'sw-common-model/src/commonTest/kotlin/org/luxons')
-rw-r--r-- | sw-common-model/src/commonTest/kotlin/org/luxons/sevenwonders/model/WonderSidePickMethodTest.kt | 91 |
1 files changed, 0 insertions, 91 deletions
diff --git a/sw-common-model/src/commonTest/kotlin/org/luxons/sevenwonders/model/WonderSidePickMethodTest.kt b/sw-common-model/src/commonTest/kotlin/org/luxons/sevenwonders/model/WonderSidePickMethodTest.kt deleted file mode 100644 index 70a061e3..00000000 --- a/sw-common-model/src/commonTest/kotlin/org/luxons/sevenwonders/model/WonderSidePickMethodTest.kt +++ /dev/null @@ -1,91 +0,0 @@ -package org.luxons.sevenwonders.model - -import kotlin.random.Random -import kotlin.test.BeforeTest -import kotlin.test.Test -import kotlin.test.assertEquals - -class WonderSidePickMethodTest { - - private lateinit var random: Random - - private lateinit var random2: Random - - @BeforeTest - fun setUp() { - random = Random(421) // starts with TRUE - random2 = Random(42) // starts with FALSE - } - - @Test - fun pick_allA() { - var side: WonderSide? = null - repeat(10) { - side = WonderSidePickMethod.ALL_A.pickSide(random, side) - assertEquals(WonderSide.A, side) - } - } - - @Test - fun pick_allB() { - var side: WonderSide? = null - repeat(10) { - side = WonderSidePickMethod.ALL_B.pickSide(random, side) - assertEquals(WonderSide.B, side) - } - } - - @Test - fun pick_eachRandom() { - var side = WonderSidePickMethod.EACH_RANDOM.pickSide(random, null) - assertEquals(WonderSide.A, side) - side = WonderSidePickMethod.EACH_RANDOM.pickSide(random, side) - assertEquals(WonderSide.A, side) - side = WonderSidePickMethod.EACH_RANDOM.pickSide(random, side) - assertEquals(WonderSide.B, side) - side = WonderSidePickMethod.EACH_RANDOM.pickSide(random, side) - assertEquals(WonderSide.A, side) - side = WonderSidePickMethod.EACH_RANDOM.pickSide(random, side) - assertEquals(WonderSide.B, side) - side = WonderSidePickMethod.EACH_RANDOM.pickSide(random, side) - assertEquals(WonderSide.B, side) - } - - @Test - fun pick_eachRandom2() { - var side = WonderSidePickMethod.EACH_RANDOM.pickSide(random2, null) - assertEquals(WonderSide.B, side) - side = WonderSidePickMethod.EACH_RANDOM.pickSide(random2, side) - assertEquals(WonderSide.B, side) - side = WonderSidePickMethod.EACH_RANDOM.pickSide(random2, side) - assertEquals(WonderSide.A, side) - side = WonderSidePickMethod.EACH_RANDOM.pickSide(random2, side) - assertEquals(WonderSide.A, side) - side = WonderSidePickMethod.EACH_RANDOM.pickSide(random2, side) - assertEquals(WonderSide.B, side) - side = WonderSidePickMethod.EACH_RANDOM.pickSide(random2, side) - assertEquals(WonderSide.B, side) - } - - @Test - fun pick_allSameRandom_sameAsFirst() { - repeat(10) { - val side = WonderSidePickMethod.SAME_RANDOM_FOR_ALL.pickSide(random, - WonderSide.A - ) - assertEquals(WonderSide.A, side) - } - repeat(10) { - val side = WonderSidePickMethod.SAME_RANDOM_FOR_ALL.pickSide(random, - WonderSide.B - ) - assertEquals(WonderSide.B, side) - } - } - - @Test - fun pick_allSameRandom_firstIsRandom() { - assertEquals(WonderSide.A, WonderSidePickMethod.SAME_RANDOM_FOR_ALL.pickSide(random, null)) - assertEquals(WonderSide.B, WonderSidePickMethod.SAME_RANDOM_FOR_ALL.pickSide(random2, null)) - } -} |