1
exercism fetch scala pythagorean-triplet

src/test/scala/PythagoreanTripletTest.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
30
import org.scalatest.{FunSuite, Matchers}

/** @version created manually **/
class PythagoreanTripletTest extends FunSuite with Matchers {
  test("isPythagorean") {
    PythagoreanTriplet.isPythagorean((3, 4, 5)) should be (true)
    PythagoreanTriplet.isPythagorean((3, 5, 4)) should be (true)
    PythagoreanTriplet.isPythagorean((4, 3, 5)) should be (true)
    PythagoreanTriplet.isPythagorean((4, 5, 3)) should be (true)
    PythagoreanTriplet.isPythagorean((5, 3, 4)) should be (true)
    PythagoreanTriplet.isPythagorean((5, 4, 3)) should be (true)
    PythagoreanTriplet.isPythagorean((3, 3, 3)) should be (false)
    PythagoreanTriplet.isPythagorean((5, 6, 7)) should be (false)
  }

  test("pythagoreanTriplets 1 to 10") {
    pending
    PythagoreanTriplet.pythagoreanTriplets(1, 10) should be (Seq((3, 4, 5), (6, 8, 10)))
  }

  test("pythagoreanTriplets 11 to 20") {
    pending
    PythagoreanTriplet.pythagoreanTriplets(11, 20) should be (Seq((12, 16, 20)))
  }

  test("pythagoreanTriplets 56 to 95") {
    pending
    PythagoreanTriplet.pythagoreanTriplets(56, 95) should be (Seq((57, 76, 95), (60, 63, 87)))
  }
}