Sha256: 05759e24d80f0f77f620ab691ab00826d369a5f7eceb3bdf2451b894bbcda07d

Contents?: true

Size: 1.78 KB

Versions: 219

Compression:

Stored size: 1.78 KB

Contents

import org.scalatest.{Matchers, FlatSpec}

class MinesweeperTest extends FlatSpec with Matchers {

  it should "handle zero size board" in {
    Minesweeper.annotate(List.empty) should equal(List.empty)
  }

  it should "handle empty board" in {
    pending
    Minesweeper.annotate(List("   ",
                              "   ",
                              "   ")) should
      equal(List("   ",
                 "   ",
                 "   "))
  }

  it should "handle board full of mines" in {
    pending
    Minesweeper.annotate(List("***",
                              "***",
                              "***")) should
      equal(List("***",
                 "***",
                 "***"))
  }

  it should "handle surrounded" in {
    pending
    Minesweeper.annotate(List("***",
                              "* *",
                              "***")) should
      equal(List("***",
                 "*8*",
                 "***"))
  }

  it should "handle horizontal line" in {
    pending
    Minesweeper.annotate(List(" * * ")) should
      equal(List("1*2*1"))
  }


  it should "handle vertical line" in {
    pending
    Minesweeper.annotate(List(" ",
                              "*",
                              " ",
                              "*",
                              " ")) should
      equal(List("1",
                 "*",
                 "2",
                 "*",
                 "1"))
  }

  it should "handle cross" in {
    pending
    Minesweeper.annotate(List("  *  ",
                              "  *  ",
                              "*****",
                              "  *  ",
                              "  *  ")) should
      equal(List(" 2*2 ",
                 "25*52",
                 "*****",
                 "25*52",
                 " 2*2 "))
  }
}

Version data entries

219 entries across 219 versions & 1 rubygems

Version Path
trackler-2.0.8.51 tracks/scala/exercises/minesweeper/src/test/scala/MinesweeperTest.scala
trackler-2.0.8.50 tracks/scala/exercises/minesweeper/src/test/scala/MinesweeperTest.scala
trackler-2.0.8.49 tracks/scala/exercises/minesweeper/src/test/scala/MinesweeperTest.scala
trackler-2.0.8.48 tracks/scala/exercises/minesweeper/src/test/scala/MinesweeperTest.scala
trackler-2.0.8.47 tracks/scala/exercises/minesweeper/src/test/scala/MinesweeperTest.scala
trackler-2.0.8.46 tracks/scala/exercises/minesweeper/src/test/scala/MinesweeperTest.scala
trackler-2.0.8.45 tracks/scala/exercises/minesweeper/src/test/scala/MinesweeperTest.scala
trackler-2.0.8.44 tracks/scala/exercises/minesweeper/src/test/scala/MinesweeperTest.scala
trackler-2.0.8.43 tracks/scala/exercises/minesweeper/src/test/scala/MinesweeperTest.scala
trackler-2.0.8.42 tracks/scala/exercises/minesweeper/src/test/scala/MinesweeperTest.scala
trackler-2.0.8.41 tracks/scala/exercises/minesweeper/src/test/scala/MinesweeperTest.scala
trackler-2.0.8.40 tracks/scala/exercises/minesweeper/src/test/scala/MinesweeperTest.scala
trackler-2.0.8.39 tracks/scala/exercises/minesweeper/src/test/scala/MinesweeperTest.scala
trackler-2.0.8.38 tracks/scala/exercises/minesweeper/src/test/scala/MinesweeperTest.scala
trackler-2.0.8.37 tracks/scala/exercises/minesweeper/src/test/scala/MinesweeperTest.scala
trackler-2.0.8.36 tracks/scala/exercises/minesweeper/src/test/scala/MinesweeperTest.scala
trackler-2.0.8.35 tracks/scala/exercises/minesweeper/src/test/scala/MinesweeperTest.scala
trackler-2.0.8.34 tracks/scala/exercises/minesweeper/src/test/scala/MinesweeperTest.scala
trackler-2.0.8.33 tracks/scala/exercises/minesweeper/src/test/scala/MinesweeperTest.scala
trackler-2.0.8.32 tracks/scala/exercises/minesweeper/src/test/scala/MinesweeperTest.scala