Sha256: 7f094a32ef1a4300102715f8f823f56eae2e875fa4a07d953dea1bbbbf569dd7

Contents?: true

Size: 1.39 KB

Versions: 248

Compression:

Stored size: 1.39 KB

Contents

import org.scalatest.{FunSuite, Matchers}
import java.time.LocalDate
import LensPerson._

class LensPersonTest extends FunSuite with Matchers {
  val testPerson =
    Person(
        _name = Name(
            _foreNames = "Jane Joanna",
            _surName = "Doe"),
        _born = Born(
            _bornAt = Address(
                _street = "Longway",
                _houseNumber = 1024,
                _place = "Springfield",
                _country = "United States"),
            _bornOn = toEpochDay(1984, 4, 12)),
        _address = Address(
            _street = "Shortlane",
            _houseNumber = 2,
            _place = "Fallmeadow",
            _country = "Canada"))

  def toEpochDay(year: Int, month: Int, dayOfMonth: Int) =
    LocalDate.of(year, month, dayOfMonth).toEpochDay

  test("bornStreet") {
    bornStreet(testPerson._born) should be ("Longway")
  }

  test("setCurrentStreet") {
    pending
    (setCurrentStreet("Middleroad")(testPerson))._address._street should be ("Middleroad")
  }

  test("setBirthMonth") {
    pending
    setBirthMonth(9)(testPerson)._born._bornOn should be (toEpochDay(1984, 9, 12))
  }

  test("renameStreets birth") {
    pending
    renameStreets(_.toUpperCase)(testPerson)._born._bornAt._street should be ("LONGWAY")
  }

  test("renameStreets current") {
    pending
    renameStreets(_.toUpperCase)(testPerson)._address._street should be ("SHORTLANE")
  }
}

Version data entries

248 entries across 248 versions & 1 rubygems

Version Path
trackler-2.1.0.32 tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala
trackler-2.1.0.31 tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala
trackler-2.1.0.30 tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala
trackler-2.1.0.29 tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala
trackler-2.1.0.28 tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala
trackler-2.1.0.27 tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala
trackler-2.1.0.26 tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala
trackler-2.1.0.25 tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala
trackler-2.1.0.24 tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala
trackler-2.1.0.23 tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala
trackler-2.1.0.22 tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala
trackler-2.1.0.21 tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala
trackler-2.1.0.20 tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala
trackler-2.1.0.19 tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala
trackler-2.1.0.18 tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala
trackler-2.1.0.17 tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala
trackler-2.1.0.16 tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala
trackler-2.1.0.15 tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala
trackler-2.1.0.14 tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala
trackler-2.1.0.13 tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala