Sha256: af4239bc2fb210ff30c354a667c61cb82db3229f8a863ff6aa76d1253b033476

Contents?: true

Size: 1.17 KB

Versions: 76

Compression:

Stored size: 1.17 KB

Contents

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

76 entries across 76 versions & 1 rubygems

Version Path
trackler-2.2.1.98 tracks/fsharp/exercises/lens-person/LensPersonTest.fs
trackler-2.2.1.97 tracks/fsharp/exercises/lens-person/LensPersonTest.fs
trackler-2.2.1.96 tracks/fsharp/exercises/lens-person/LensPersonTest.fs
trackler-2.2.1.95 tracks/fsharp/exercises/lens-person/LensPersonTest.fs
trackler-2.2.1.94 tracks/fsharp/exercises/lens-person/LensPersonTest.fs
trackler-2.2.1.93 tracks/fsharp/exercises/lens-person/LensPersonTest.fs
trackler-2.2.1.92 tracks/fsharp/exercises/lens-person/LensPersonTest.fs
trackler-2.2.1.91 tracks/fsharp/exercises/lens-person/LensPersonTest.fs
trackler-2.2.1.90 tracks/fsharp/exercises/lens-person/LensPersonTest.fs
trackler-2.2.1.89 tracks/fsharp/exercises/lens-person/LensPersonTest.fs
trackler-2.2.1.88 tracks/fsharp/exercises/lens-person/LensPersonTest.fs
trackler-2.2.1.87 tracks/fsharp/exercises/lens-person/LensPersonTest.fs
trackler-2.2.1.86 tracks/fsharp/exercises/lens-person/LensPersonTest.fs
trackler-2.2.1.85 tracks/fsharp/exercises/lens-person/LensPersonTest.fs
trackler-2.2.1.84 tracks/fsharp/exercises/lens-person/LensPersonTest.fs
trackler-2.2.1.83 tracks/fsharp/exercises/lens-person/LensPersonTest.fs
trackler-2.2.1.82 tracks/fsharp/exercises/lens-person/LensPersonTest.fs
trackler-2.2.1.81 tracks/fsharp/exercises/lens-person/LensPersonTest.fs
trackler-2.2.1.80 tracks/fsharp/exercises/lens-person/LensPersonTest.fs
trackler-2.2.1.79 tracks/fsharp/exercises/lens-person/LensPersonTest.fs