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.2.1.30 tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala
trackler-2.2.1.29 tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala
trackler-2.2.1.28 tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala
trackler-2.2.1.27 tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala
trackler-2.2.1.26 tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala
trackler-2.2.1.25 tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala
trackler-2.2.1.24 tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala
trackler-2.2.1.23 tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala
trackler-2.2.1.22 tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala
trackler-2.2.1.21 tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala
trackler-2.2.1.20 tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala
trackler-2.2.1.19 tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala
trackler-2.2.1.18 tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala
trackler-2.2.1.17 tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala
trackler-2.2.1.16 tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala
trackler-2.2.1.15 tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala
trackler-2.2.1.14 tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala
trackler-2.2.1.13 tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala
trackler-2.2.1.12 tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala
trackler-2.2.1.11 tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala