Sha256: 630f4528dfccb97bf61e798a119547b656519f9c30b0d4b0d0805454227ff297

Contents?: true

Size: 1.76 KB

Versions: 67

Compression:

Stored size: 1.76 KB

Contents

import org.scalatest.{Matchers, FunSuite}

/** @version 1.1.0 */
class SayTest extends FunSuite with Matchers {

  test("zero") {
    Say.inEnglish(0) should be(Some("zero"))
  }

  test("one") {
    pending
    Say.inEnglish(1) should be(Some("one"))
  }

  test("fourteen") {
    pending
    Say.inEnglish(14) should be(Some("fourteen"))
  }

  test("twenty") {
    pending
    Say.inEnglish(20) should be(Some("twenty"))
  }

  test("twenty-two") {
    pending
    Say.inEnglish(22) should be(Some("twenty-two"))
  }

  test("one hundred") {
    pending
    Say.inEnglish(100) should be(Some("one hundred"))
  }

  test("one hundred twenty-three") {
    pending
    Say.inEnglish(123) should be(Some("one hundred twenty-three"))
  }

  test("one thousand") {
    pending
    Say.inEnglish(1000) should be(Some("one thousand"))
  }

  test("one thousand two hundred thirty-four") {
    pending
    Say.inEnglish(1234) should be(Some("one thousand two hundred thirty-four"))
  }

  test("one million") {
    pending
    Say.inEnglish(1000000) should be(Some("one million"))
  }

  test("one million two thousand three hundred forty-five") {
    pending
    Say.inEnglish(1002345) should be(Some("one million two thousand three hundred forty-five"))
  }

  test("one billion") {
    pending
    Say.inEnglish(1000000000) should be(Some("one billion"))
  }

  test("a big number") {
    pending
    Say.inEnglish(987654321123l) should be(Some("nine hundred eighty-seven billion six hundred fifty-four million three hundred twenty-one thousand one hundred twenty-three"))
  }

  test("numbers below zero are out of range") {
    pending
    Say.inEnglish(-1) should be(None)
  }

  test("numbers above 999,999,999,999 are out of range") {
    pending
    Say.inEnglish(1000000000000l) should be(None)
  }
}

Version data entries

67 entries across 67 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/scala/exercises/say/src/test/scala/SayTest.scala
trackler-2.2.1.179 tracks/scala/exercises/say/src/test/scala/SayTest.scala
trackler-2.2.1.178 tracks/scala/exercises/say/src/test/scala/SayTest.scala
trackler-2.2.1.177 tracks/scala/exercises/say/src/test/scala/SayTest.scala
trackler-2.2.1.176 tracks/scala/exercises/say/src/test/scala/SayTest.scala
trackler-2.2.1.175 tracks/scala/exercises/say/src/test/scala/SayTest.scala
trackler-2.2.1.174 tracks/scala/exercises/say/src/test/scala/SayTest.scala
trackler-2.2.1.173 tracks/scala/exercises/say/src/test/scala/SayTest.scala
trackler-2.2.1.172 tracks/scala/exercises/say/src/test/scala/SayTest.scala
trackler-2.2.1.171 tracks/scala/exercises/say/src/test/scala/SayTest.scala
trackler-2.2.1.170 tracks/scala/exercises/say/src/test/scala/SayTest.scala
trackler-2.2.1.169 tracks/scala/exercises/say/src/test/scala/SayTest.scala
trackler-2.2.1.167 tracks/scala/exercises/say/src/test/scala/SayTest.scala
trackler-2.2.1.166 tracks/scala/exercises/say/src/test/scala/SayTest.scala
trackler-2.2.1.165 tracks/scala/exercises/say/src/test/scala/SayTest.scala
trackler-2.2.1.164 tracks/scala/exercises/say/src/test/scala/SayTest.scala
trackler-2.2.1.163 tracks/scala/exercises/say/src/test/scala/SayTest.scala
trackler-2.2.1.162 tracks/scala/exercises/say/src/test/scala/SayTest.scala
trackler-2.2.1.161 tracks/scala/exercises/say/src/test/scala/SayTest.scala
trackler-2.2.1.160 tracks/scala/exercises/say/src/test/scala/SayTest.scala