Sha256: 73ed5701fe29c0b474183c2dffc32d7704ffd8e44063aaf937387e166f1db2e5

Contents?: true

Size: 1.91 KB

Versions: 63

Compression:

Stored size: 1.91 KB

Contents

import org.scalatest.{Matchers, FunSuite}

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

  test("addition") {
    Wordy.answer("What is 1 plus 1?") should be(Some(2))
  }

  test("more addition") {
    pending
    Wordy.answer("What is 53 plus 2?") should be(Some(55))
  }

  test("addition with negative numbers") {
    pending
    Wordy.answer("What is -1 plus -10?") should be(Some(-11))
  }

  test("large addition") {
    pending
    Wordy.answer("What is 123 plus 45678?") should be(Some(45801))
  }

  test("subtraction") {
    pending
    Wordy.answer("What is 4 minus -12?") should be(Some(16))
  }

  test("multiplication") {
    pending
    Wordy.answer("What is -3 multiplied by 25?") should be(Some(-75))
  }

  test("division") {
    pending
    Wordy.answer("What is 33 divided by -3?") should be(Some(-11))
  }

  test("multiple additions") {
    pending
    Wordy.answer("What is 1 plus 1 plus 1?") should be(Some(3))
  }

  test("addition and subtraction") {
    pending
    Wordy.answer("What is 1 plus 5 minus -2?") should be(Some(8))
  }

  test("multiple subtraction") {
    pending
    Wordy.answer("What is 20 minus 4 minus 13?") should be(Some(3))
  }

  test("subtraction then addition") {
    pending
    Wordy.answer("What is 17 minus 6 plus 3?") should be(Some(14))
  }

  test("multiple multiplication") {
    pending
    Wordy.answer("What is 2 multiplied by -2 multiplied by 3?") should be(
      Some(-12))
  }

  test("addition and multiplication") {
    pending
    Wordy.answer("What is -3 plus 7 multiplied by -2?") should be(Some(-8))
  }

  test("multiple division") {
    pending
    Wordy.answer("What is -12 divided by 2 divided by -3?") should be(Some(2))
  }

  test("unknown operation") {
    pending
    Wordy.answer("What is 52 cubed?") should be(None)
  }

  test("Non math question") {
    pending
    Wordy.answer("Who is the President of the United States?") should be(None)
  }
}

Version data entries

63 entries across 63 versions & 1 rubygems

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