Sha256: a51ef54ff3f66129ccba45d0b62e825d78c8cc751a98420f313cb48aebebea5f

Contents?: true

Size: 1.02 KB

Versions: 34

Compression:

Stored size: 1.02 KB

Contents

import org.scalatest.{Matchers, FlatSpec}

class TriangleTest extends FlatSpec with Matchers {
  it should "calc Equilateral" in {
    Triangle(2, 2, 2).triangleType should equal(TriangleType.Equilateral)
  }

  it should "calc Equilateral2" in {
    Triangle(10, 10, 10).triangleType should equal(TriangleType.Equilateral)
  }

  it should "calc Isosceles" in {
    Triangle(3, 4, 4).triangleType should equal(TriangleType.Isosceles)
  }

  it should "calc Isosceles2" in {
    Triangle(4, 3, 4).triangleType should equal(TriangleType.Isosceles)
  }

  it should "calc Scalene" in {
    Triangle(3, 4, 5).triangleType should equal(TriangleType.Scalene)
  }

  it should "calc Illogical" in {
    Triangle(1, 1, 50).triangleType should equal(TriangleType.Illogical)
  }

  it should "calc Illogical with zero length side" in {
    Triangle(0, 2, 1).triangleType should equal(TriangleType.Illogical)
  }

  it should "calc Illogical with negative length side" in {
    Triangle(1, 1, -1).triangleType should equal(TriangleType.Illogical)
  }
}

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
trackler-2.0.3.8 tracks/scala/exercises/triangle/src/test/scala/triangle_test.scala
trackler-2.0.3.7 tracks/scala/exercises/triangle/src/test/scala/triangle_test.scala
trackler-2.0.3.6 tracks/scala/exercises/triangle/src/test/scala/triangle_test.scala
trackler-2.0.3.5 tracks/scala/exercises/triangle/src/test/scala/triangle_test.scala
trackler-2.0.3.4 tracks/scala/exercises/triangle/src/test/scala/triangle_test.scala
trackler-2.0.3.3 tracks/scala/exercises/triangle/src/test/scala/triangle_test.scala
trackler-2.0.3.2 tracks/scala/exercises/triangle/src/test/scala/triangle_test.scala
trackler-2.0.3.1 tracks/scala/exercises/triangle/src/test/scala/triangle_test.scala
trackler-2.0.3.0 tracks/scala/exercises/triangle/src/test/scala/triangle_test.scala
trackler-2.0.2.0 tracks/scala/exercises/triangle/src/test/scala/triangle_test.scala
trackler-2.0.1.2 tracks/scala/exercises/triangle/src/test/scala/triangle_test.scala
trackler-2.0.1.1 tracks/scala/exercises/triangle/src/test/scala/triangle_test.scala
trackler-2.0.1.0 tracks/scala/exercises/triangle/src/test/scala/triangle_test.scala
trackler-2.0.0.10 tracks/scala/exercises/triangle/src/test/scala/triangle_test.scala
trackler-2.0.0.9 tracks/scala/exercises/triangle/src/test/scala/triangle_test.scala
trackler-2.0.0.8 tracks/scala/exercises/triangle/src/test/scala/triangle_test.scala
trackler-2.0.0.7 tracks/scala/exercises/triangle/src/test/scala/triangle_test.scala
trackler-2.0.0.6 tracks/scala/exercises/triangle/src/test/scala/triangle_test.scala
trackler-2.0.0.5 tracks/scala/exercises/triangle/src/test/scala/triangle_test.scala
trackler-2.0.0.4 tracks/scala/exercises/triangle/src/test/scala/triangle_test.scala