Sha256: bc4867fe4ecb7e3a050d542574386671eb97f1f5864bc97ab349fccc165fae97

Contents?: true

Size: 1.23 KB

Versions: 80

Compression:

Stored size: 1.23 KB

Contents

// This file was created manually and its version is 1.0.0.

module LensPersonTest

open System
open Xunit
open FsUnit.Xunit
open Aether
open Aether.Operators
open LensPerson

let testPerson =
    { name = 
        { name = "Jane Joanna"
          surName = "Doe" }
      born = 
        { at = 
            { street = "Longway"
              houseNumber = 1024
              place = "Springfield"
              country = "United States" }
          on = DateTime(1984, 4, 12) }
      address = 
        { street = "Shortlane"
          houseNumber = 2
          place = "Fallmeadow"
          country = "Canada" } }

[<Fact>]
let ``Set born at street`` () =
    Optic.get bornAtStreet testPerson |> should equal "Longway"

[<Fact(Skip = "Remove to run test")>]
let ``Set current street`` () =
    Optic.set currentStreet "Middleroad" testPerson |> Optic.get currentStreet |> should equal "Middleroad"

[<Fact(Skip = "Remove to run test")>]
let ``Upper case born at street`` () =
    Optic.map bornAtStreet (fun x -> x.ToUpper()) testPerson |> Optic.get bornAtStreet |> should equal "LONGWAY"

[<Fact(Skip = "Remove to run test")>]
let ``Set birth month`` () =
    Optic.set birthMonth 9 testPerson |> Optic.get bornOn |> should equal <| DateTime(1984, 9, 12)

Version data entries

80 entries across 80 versions & 1 rubygems

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