Skip to content

Commit 1b4995d

Browse files
author
Xerus
committed
test(plugin): add some tests for clone methods
1 parent a69626d commit 1b4995d

File tree

2 files changed

+23
-5
lines changed

2 files changed

+23
-5
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package sc.plugin2020
2+
3+
import io.kotlintest.shouldBe
4+
import io.kotlintest.specs.StringSpec
5+
import sc.framework.plugins.Player
6+
import sc.shared.PlayerColor
7+
8+
class CloneTest: StringSpec({
9+
"clone Player" {
10+
val player = Player(PlayerColor.RED, "aPlayer")
11+
player.clone() shouldBe player
12+
}
13+
"clone Board" {
14+
val board = Board()
15+
board.clone() shouldBe board
16+
}
17+
"clone GameState" {
18+
val state = GameState(blue = Player(PlayerColor.BLUE, "aBluePlayer"), turn = 5)
19+
val clone = state.clone()
20+
clone shouldBe state
21+
clone.getDeployedPieces(PlayerColor.RED) shouldBe state.getDeployedPieces(PlayerColor.RED)
22+
}
23+
})

plugin/src/test/sc/plugin2020/PlayerTest.java

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)