@@ -8,6 +8,7 @@ import io.kotest.matchers.collections.shouldContainExactlyInAnyOrder
88import io.kotest.matchers.maps.shouldBeEmpty
99import io.kotest.matchers.maps.shouldHaveSize
1010import io.kotest.matchers.maps.shouldNotBeEmpty
11+ import io.kotest.matchers.nulls.shouldBeNull
1112import io.kotest.matchers.shouldBe
1213import io.kotest.matchers.string.shouldHaveLineCount
1314import io.kotest.matchers.string.shouldNotContain
@@ -72,7 +73,7 @@ class BoardTest: FunSpec({
7273 test("from position") {
7374 val moewe = Piece (Moewe , Team .ONE )
7475 val board = Board (mutableMapOf(coords to moewe))
75- board.movePiece(Move (coords, coords.copy(y = 7))) shouldBe null
76+ board.movePiece(Move (coords, coords.copy(y = 7))).shouldBeNull()
7677 board.shouldBeEmpty()
7778 }
7879 test("not from Robbe in position") {
@@ -81,9 +82,20 @@ class BoardTest: FunSpec({
8182 board.movePiece(Move (coords, Coordinates (2, 7))) shouldBe robbe
8283 board.shouldNotBeEmpty()
8384 }
84- test("from tower") {
85- val tower = Piece (Herzmuschel , Team .ONE , 2)
86- val board = Board (mutableMapOf())
85+ context("from tower") {
86+ val board = makeBoard(0 y 1 to "M ", 0 y 0 to "S2 ", 1 y 0 to "m", 1 y 1 to "r")
87+ test("not onto own") {
88+ shouldThrow<InvalidMoveException > {
89+ board.movePiece(Move (0 y 0, 0 y 1))
90+ }.mistake shouldBe MoveMistake .DESTINATION_BLOCKED
91+ }
92+ test("move tower") {
93+ board.movePiece(Move (0 y 0, 1 y 1)).shouldBeNull()
94+ }
95+ test("move onto tower") {
96+ // TODO that should be a double amber
97+ board.movePiece(Move (1 y 0, 0 y 0)).shouldBeNull()
98+ }
8799 }
88100 }
89101 }
0 commit comments