Sha256: 72535ccc290f91a039a5e15405a4ace7f1df73cc0296a2e396f8909c6c497238

Contents?: true

Size: 1.38 KB

Versions: 148

Compression:

Stored size: 1.38 KB

Contents

import org.scalatest._

/** @version created manually **/
class GradeSchoolTest extends FunSuite with Matchers with OneInstancePerTest {
  val school = new School

  test ("empty school") {
    school.db should be (Map())
  }

  test ("add student") {
    pending
    school.add("Aimee", 2)
    school.db should be (Map(2 -> Seq("Aimee")))
  }

  test ("add more students in same class") {
    pending
    school.add("James", 2)
    school.add("Blair", 2)
    school.add("Paul", 2)
    school.db should be (Map(2 -> Seq("James", "Blair", "Paul")))
  }

  test ("add students to different grades") {
    pending
    school.add("Chelsea", 3)
    school.add("Logan", 7)
    school.db should be (Map(3 -> Seq("Chelsea"), 7 -> Seq("Logan")))
  }

  test ("get students in a grade") {
    pending
    school.add("Franklin", 5)
    school.add("Bradley", 5)
    school.add("Jeff", 1)
    school.grade(5) should be (Seq("Franklin", "Bradley"))
  }

  test ("get students in a non-existant grade") {
    pending
    school.grade(1) should be (Seq())
  }

  test ("sort school") {
    pending
    school.add("Jennifer", 4)
    school.add("Kareem", 6)
    school.add("Christopher", 4)
    school.add("Kyle", 3)
    val sorted = Map(
      3 -> Seq("Kyle"),
      4 -> Seq("Christopher", "Jennifer"),
      6 -> Seq("Kareem")
    )
    school.sorted should be (sorted)
    school.sorted.keys.toList should be (Seq(3, 4, 6))
  }
}

Version data entries

148 entries across 148 versions & 1 rubygems

Version Path
trackler-2.2.1.98 tracks/scala/exercises/grade-school/src/test/scala/GradeSchoolTest.scala
trackler-2.2.1.97 tracks/scala/exercises/grade-school/src/test/scala/GradeSchoolTest.scala
trackler-2.2.1.96 tracks/scala/exercises/grade-school/src/test/scala/GradeSchoolTest.scala
trackler-2.2.1.95 tracks/scala/exercises/grade-school/src/test/scala/GradeSchoolTest.scala
trackler-2.2.1.94 tracks/scala/exercises/grade-school/src/test/scala/GradeSchoolTest.scala
trackler-2.2.1.93 tracks/scala/exercises/grade-school/src/test/scala/GradeSchoolTest.scala
trackler-2.2.1.92 tracks/scala/exercises/grade-school/src/test/scala/GradeSchoolTest.scala
trackler-2.2.1.91 tracks/scala/exercises/grade-school/src/test/scala/GradeSchoolTest.scala
trackler-2.2.1.90 tracks/scala/exercises/grade-school/src/test/scala/GradeSchoolTest.scala
trackler-2.2.1.89 tracks/scala/exercises/grade-school/src/test/scala/GradeSchoolTest.scala
trackler-2.2.1.88 tracks/scala/exercises/grade-school/src/test/scala/GradeSchoolTest.scala
trackler-2.2.1.87 tracks/scala/exercises/grade-school/src/test/scala/GradeSchoolTest.scala
trackler-2.2.1.86 tracks/scala/exercises/grade-school/src/test/scala/GradeSchoolTest.scala
trackler-2.2.1.85 tracks/scala/exercises/grade-school/src/test/scala/GradeSchoolTest.scala
trackler-2.2.1.84 tracks/scala/exercises/grade-school/src/test/scala/GradeSchoolTest.scala
trackler-2.2.1.83 tracks/scala/exercises/grade-school/src/test/scala/GradeSchoolTest.scala
trackler-2.2.1.82 tracks/scala/exercises/grade-school/src/test/scala/GradeSchoolTest.scala
trackler-2.2.1.81 tracks/scala/exercises/grade-school/src/test/scala/GradeSchoolTest.scala
trackler-2.2.1.80 tracks/scala/exercises/grade-school/src/test/scala/GradeSchoolTest.scala
trackler-2.2.1.79 tracks/scala/exercises/grade-school/src/test/scala/GradeSchoolTest.scala