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.2.1.13 tracks/scala/exercises/minesweeper/src/test/scala/MinesweeperTest.scala
trackler-2.2.1.12 tracks/scala/exercises/minesweeper/src/test/scala/MinesweeperTest.scala
trackler-2.2.1.11 tracks/scala/exercises/minesweeper/src/test/scala/MinesweeperTest.scala
trackler-2.2.1.10 tracks/scala/exercises/minesweeper/src/test/scala/MinesweeperTest.scala
trackler-2.2.1.9 tracks/scala/exercises/minesweeper/src/test/scala/MinesweeperTest.scala
trackler-2.2.1.8 tracks/scala/exercises/minesweeper/src/test/scala/MinesweeperTest.scala
trackler-2.2.1.7 tracks/scala/exercises/minesweeper/src/test/scala/MinesweeperTest.scala
trackler-2.2.1.6 tracks/scala/exercises/minesweeper/src/test/scala/MinesweeperTest.scala
trackler-2.2.1.5 tracks/scala/exercises/minesweeper/src/test/scala/MinesweeperTest.scala
trackler-2.2.1.4 tracks/scala/exercises/minesweeper/src/test/scala/MinesweeperTest.scala
trackler-2.2.1.3 tracks/scala/exercises/minesweeper/src/test/scala/MinesweeperTest.scala
trackler-2.2.1.2 tracks/scala/exercises/minesweeper/src/test/scala/MinesweeperTest.scala
trackler-2.2.1.1 tracks/scala/exercises/minesweeper/src/test/scala/MinesweeperTest.scala
trackler-2.2.1.0 tracks/scala/exercises/minesweeper/src/test/scala/MinesweeperTest.scala
trackler-2.2.0.6 tracks/scala/exercises/minesweeper/src/test/scala/MinesweeperTest.scala
trackler-2.2.0.5 tracks/scala/exercises/minesweeper/src/test/scala/MinesweeperTest.scala
trackler-2.2.0.4 tracks/scala/exercises/minesweeper/src/test/scala/MinesweeperTest.scala
trackler-2.2.0.3 tracks/scala/exercises/minesweeper/src/test/scala/MinesweeperTest.scala
trackler-2.2.0.2 tracks/scala/exercises/minesweeper/src/test/scala/MinesweeperTest.scala
trackler-2.2.0.1 tracks/scala/exercises/minesweeper/src/test/scala/MinesweeperTest.scala