Write the first test

This commit is contained in:
Sven van Heugten 2026-01-04 09:09:50 +01:00
parent fc069edf31
commit 109ebde64a
3 changed files with 44 additions and 0 deletions

View file

@ -0,0 +1,22 @@
namespace NightLight.Core.Tests
open System
open FsCheck.FSharp
open NightLight.Core.Models
type Arbitraries =
static member Interaction() =
let genTimeChangedInteraction =
gen {
let! time = ArbMap.defaults |> ArbMap.generate<DateTime>
return Interaction.TimeChanged time
}
let genHumanInteraction =
gen {
let! light = Gen.elements lights
let! humanInteraction = Gen.elements [ LightTurnedOn light; LightTurnedOff light ]
return Interaction.HumanInteraction humanInteraction
}
Gen.oneof [ genTimeChangedInteraction; genHumanInteraction ] |> Arb.fromGen