Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AlinaStepanova committed Mar 20, 2024
1 parent b7d8976 commit f1a8040
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 33 deletions.
2 changes: 1 addition & 1 deletion .idea/deploymentTargetDropDown.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

64 changes: 32 additions & 32 deletions app/src/test/java/com/avs/sea/battle/main/ShotManagerTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -243,37 +243,37 @@ class ShotManagerTest {

@Test
fun getCoordinateToShot() {
var coordinate = shotManager.getCoordinateToShot()
assertEquals(coordinate, shotManager.getFirstCell().getCoordinate())
shotManager.handleShot(true)
assertFalse(shotManager.getBattleField().isCellFreeToBeSelected(coordinate))
coordinate = shotManager.getCoordinateToShot()
assertEquals(coordinate, shotManager.getSecondCell().getCoordinate())
shotManager.handleShot(true)
assertFalse(shotManager.getBattleField().isCellFreeToBeSelected(coordinate))
coordinate = shotManager.getCoordinateToShot()
assertEquals(coordinate, shotManager.getThirdCell().getCoordinate())
shotManager.handleShot(true)
assertFalse(shotManager.getBattleField().isCellFreeToBeSelected(coordinate))
coordinate = shotManager.getCoordinateToShot()
assertEquals(coordinate, shotManager.getFourthCell().getCoordinate())
shotManager.handleShot(true)
assertFalse(shotManager.getBattleField().isCellFreeToBeSelected(coordinate))
coordinate = shotManager.getCoordinateToShot()
assertEquals(coordinate, shotManager.getFirstCell().getCoordinate())
shotManager.handleShot(false)
assertFalse(shotManager.getBattleField().isCellFreeToBeSelected(coordinate))
coordinate = shotManager.getCoordinateToShot()
assertEquals(coordinate, shotManager.getFirstCell().getCoordinate())
shotManager.handleShot(true)
assertFalse(shotManager.getBattleField().isCellFreeToBeSelected(coordinate))
coordinate = shotManager.getCoordinateToShot()
assertEquals(coordinate, shotManager.getSecondCell().getCoordinate())
shotManager.handleShot(false)
assertFalse(shotManager.getBattleField().isCellFreeToBeSelected(coordinate))
coordinate = shotManager.getCoordinateToShot()
assertEquals(coordinate, shotManager.getSecondCell().getCoordinate())
shotManager.handleShot(true)
assertFalse(shotManager.getBattleField().isCellFreeToBeSelected(coordinate))
val coordinate1 = shotManager.getCoordinateToShot()
assertEquals(coordinate1, shotManager.getFirstCell().getCoordinate())
shotManager.handleShot(true to ArrayList())
assertFalse(shotManager.getBattleField().isCellFreeToBeSelected(coordinate1))
val coordinate2 = shotManager.getCoordinateToShot()
assertEquals(coordinate2, shotManager.getSecondCell().getCoordinate())
shotManager.handleShot(true to ArrayList())
assertFalse(shotManager.getBattleField().isCellFreeToBeSelected(coordinate2))
val coordinate3 = shotManager.getCoordinateToShot()
assertEquals(coordinate3, shotManager.getThirdCell().getCoordinate())
shotManager.handleShot(true to ArrayList())
assertFalse(shotManager.getBattleField().isCellFreeToBeSelected(coordinate3))
val coordinate4 = shotManager.getCoordinateToShot()
assertEquals(coordinate4, shotManager.getFourthCell().getCoordinate())
shotManager.handleShot(true to arrayListOf(coordinate1, coordinate2, coordinate3, coordinate4))
assertFalse(shotManager.getBattleField().isCellFreeToBeSelected(coordinate4))
val coordinate5 = shotManager.getCoordinateToShot()
assertEquals(coordinate5, shotManager.getFirstCell().getCoordinate())
shotManager.handleShot(false to ArrayList())
assertFalse(shotManager.getBattleField().isCellFreeToBeSelected(coordinate5))
val coordinate6 = shotManager.getCoordinateToShot()
assertEquals(coordinate6, shotManager.getFirstCell().getCoordinate())
shotManager.handleShot(true to ArrayList())
assertFalse(shotManager.getBattleField().isCellFreeToBeSelected(coordinate6))
val coordinate7 = shotManager.getCoordinateToShot()
assertEquals(coordinate7, shotManager.getSecondCell().getCoordinate())
shotManager.handleShot(false to ArrayList())
assertFalse(shotManager.getBattleField().isCellFreeToBeSelected(coordinate7))
val coordinate8 = shotManager.getCoordinateToShot()
assertEquals(coordinate8, shotManager.getSecondCell().getCoordinate())
shotManager.handleShot(true to ArrayList())
assertFalse(shotManager.getBattleField().isCellFreeToBeSelected(coordinate8))
}
}

0 comments on commit f1a8040

Please sign in to comment.