Sha256: 74673ef10090aec62a6d8b54f6f559845eca2fd2552873703af0ad928c174edf

Contents?: true

Size: 1.43 KB

Versions: 148

Compression:

Stored size: 1.43 KB

Contents

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

/** @version created manually **/
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

148 entries across 148 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala
trackler-2.2.1.179 tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala
trackler-2.2.1.178 tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala
trackler-2.2.1.177 tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala
trackler-2.2.1.176 tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala
trackler-2.2.1.175 tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala
trackler-2.2.1.174 tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala
trackler-2.2.1.173 tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala
trackler-2.2.1.172 tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala
trackler-2.2.1.171 tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala
trackler-2.2.1.170 tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala
trackler-2.2.1.169 tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala
trackler-2.2.1.167 tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala
trackler-2.2.1.166 tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala
trackler-2.2.1.165 tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala
trackler-2.2.1.164 tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala
trackler-2.2.1.163 tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala
trackler-2.2.1.162 tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala
trackler-2.2.1.161 tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala
trackler-2.2.1.160 tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala