1
exercism fetch scala nth-prime

src/test/scala/NthPrimeTest.scala

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import org.scalatest.{Matchers, FunSuite}

/** @version 1.0.0 */
class NthPrimeTest extends FunSuite with Matchers {

  test("first prime") {
    NthPrime.prime(1) should be (Some(2))
  }

  test("second prime") {
    pending
    NthPrime.prime(2) should be (Some(3))
  }

  test("sixth prime") {
    pending
    NthPrime.prime(6) should be (Some(13))
  }

  test("big prime") {
    pending
    NthPrime.prime(10001) should be (Some(104743))
  }

  test("there is no zeroth prime") {
    pending
    NthPrime.prime(0) should be (None)
  }
}