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.0.6.32 tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala
trackler-2.0.6.31 tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala
trackler-2.0.6.30 tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala
trackler-2.0.6.29 tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala
trackler-2.0.6.28 tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala
trackler-2.0.6.27 tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala
trackler-2.0.6.26 tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala
trackler-2.0.6.25 tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala
trackler-2.0.6.24 tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala
trackler-2.0.6.23 tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala
trackler-2.0.6.22 tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala
trackler-2.0.6.21 tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala
trackler-2.0.6.20 tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala
trackler-2.0.6.19 tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala
trackler-2.0.6.18 tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala
trackler-2.0.6.17 tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala
trackler-2.0.6.16 tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala
trackler-2.0.6.15 tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala
trackler-2.0.6.14 tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala
trackler-2.0.6.13 tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala