Make sure that the first interaction sets the time

This is what happens in the `NightLight` program as well.
This commit is contained in:
Sven van Heugten 2026-01-04 19:41:31 +01:00
parent 4e6fc6645c
commit c8e1f0c9fe

View file

@ -1,11 +1,13 @@
namespace NightLight.Core.Tests
open System
open FsCheck
open FsCheck.FSharp
open NightLight.Core.Models
type Arbitraries =
static member Interaction() =
static member Interactions() : Arbitrary<Interaction list> =
gen {
let genTimeChangedInteraction =
gen {
let! time = ArbMap.defaults |> ArbMap.generate<DateTime>
@ -19,4 +21,9 @@ type Arbitraries =
return Interaction.HumanInteraction humanInteraction
}
Gen.oneof [ genTimeChangedInteraction; genHumanInteraction ] |> Arb.fromGen
let! initialTimeChangedInteraction = genTimeChangedInteraction
let! remainingInteractions = Gen.oneof [ genTimeChangedInteraction; genHumanInteraction ] |> Gen.listOf
return initialTimeChangedInteraction :: remainingInteractions
}
|> Arb.fromGen