Skip to content

Commit

Permalink
fix(lblock): initial position test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
Pablito2020 committed Apr 16, 2022
1 parent 5105eb2 commit da9dd32
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions src/test/kotlin/blocks/LBlock/LBlockMoveTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class LBlockMoveTest : MoveTest {
override fun `Move to Right changes column plus one`() {
lBlock.move(Direction.RIGHT)
assertEquals(
listOf(Position(2, 3), Position(3, 3), Position(4, 3), Position(4, 4)),
listOf(Position(2, 5), Position(3, 3), Position(3, 4), Position(3,5)),
lBlock.getNeededPositions()
)
}
Expand All @@ -32,7 +32,7 @@ class LBlockMoveTest : MoveTest {
lBlock.move(Direction.RIGHT)
lBlock.move(Direction.RIGHT)
assertEquals(
listOf(Position(2, 4), Position(3, 4), Position(4, 4), Position(4, 5)),
listOf(Position(2, 6), Position(3, 4), Position(3, 5), Position(3,6)),
lBlock.getNeededPositions()
)
}
Expand All @@ -41,7 +41,7 @@ class LBlockMoveTest : MoveTest {
override fun `Move to Left changes column minus one`() {
lBlock.move(Direction.LEFT)
assertEquals(
listOf(Position(2, 1), Position(3, 1), Position(4, 1), Position(4, 2)),
listOf(Position(2, 3), Position(3, 1), Position(3, 2), Position(3,3)),
lBlock.getNeededPositions()
)
}
Expand All @@ -51,7 +51,7 @@ class LBlockMoveTest : MoveTest {
lBlock.move(Direction.LEFT)
lBlock.move(Direction.LEFT)
assertEquals(
listOf(Position(2, 0), Position(3, 0), Position(4, 0), Position(4, 1)),
listOf(Position(2, 2), Position(3, 0), Position(3, 1), Position(3,2)),
lBlock.getNeededPositions()
)
}
Expand All @@ -60,7 +60,7 @@ class LBlockMoveTest : MoveTest {
override fun `Move down changes row plus one`() {
lBlock.move(Direction.DOWN)
assertEquals(
listOf(Position(3, 2), Position(4, 2), Position(5, 2), Position(5, 3)),
listOf(Position(3, 4), Position(4, 2), Position(4, 3), Position(4,4)),
lBlock.getNeededPositions()
)
}
Expand All @@ -70,7 +70,7 @@ class LBlockMoveTest : MoveTest {
lBlock.move(Direction.DOWN)
lBlock.move(Direction.DOWN)
assertEquals(
listOf(Position(4, 2), Position(5, 2), Position(6, 2), Position(6, 3)),
listOf(Position(4, 4), Position(5, 2), Position(5, 3), Position(5,4)),
lBlock.getNeededPositions()
)
}
Expand Down
12 changes: 6 additions & 6 deletions src/test/kotlin/blocks/LBlock/LBlockTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,25 @@ import kotlin.test.assertEquals
class LBlockTest {

@Test
fun `position 0,0 needed positions are (0,0), (1,0), (2,0), (2,1)`() {
fun `position 0,0 needed positions are (0,2), (1,0), (1,1), (1,2)`() {
val lBlock = LBlock(Position(0, 0))
assertEquals(listOf(Position(0, 0), Position(1, 0), Position(2, 0), Position(2,1)),
assertEquals(listOf(Position(0, 2), Position(1, 0), Position(1, 1), Position(1,2)),
lBlock.getNeededPositions()
)
}

@Test
fun `position 0,1 needed positions are (0,1), (1,1), (2,1), (2,2)`() {
fun `position 0,1 needed positions are (0,3), (1,1), (1,2), (1,3)`() {
val lBlock = LBlock(Position(0, 1))
assertEquals(listOf(Position(0, 1), Position(1, 1), Position(2, 1), Position(2,2)),
assertEquals(listOf(Position(0, 3), Position(1, 1), Position(1, 2), Position(1,3)),
lBlock.getNeededPositions()
)
}

@Test
fun `position 1,0 needed positions are (1,0), (2,0), (3,0), (3,1)`() {
fun `position 1,0 needed positions are (1,2), (2,0), (2,1), (2,2)`() {
val lBlock = LBlock(Position(1, 0))
assertEquals(listOf(Position(1, 0), Position(2, 0), Position(3, 0), Position(3,1)),
assertEquals(listOf(Position(1, 2), Position(2, 0), Position(2, 1), Position(2,2)),
lBlock.getNeededPositions()
)
}
Expand Down

0 comments on commit da9dd32

Please sign in to comment.