Generalize the genInteractionListThatEndsAtTime concept

This commit is contained in:
Sven van Heugten 2026-01-05 21:32:14 +01:00
parent 9e97d9a37b
commit 14cfaaeed5
3 changed files with 24 additions and 20 deletions

View file

@ -21,12 +21,12 @@ type NightLightTests() =
fakeHome
[<Property(Arbitrary = [| typeof<ArbitraryInteractionsListThatEndsDuringTheDay> |])>]
[<Property(Arbitrary = [| typeof<ArbitraryInteractionListThatEndsDuringTheDay> |])>]
let ``Lights should be white or yellow during the day`` (interactions: Interaction list) =
let fakeHome = createFakeHomeWithNightLightAndInteract interactions
fakeHome.ForAllLightsThatAreOn(fun (_, _, color) -> color = White || color = Yellow)
[<Property(Arbitrary = [| typeof<ArbitraryInteractionsListThatEndsDuringTheNight> |])>]
[<Property(Arbitrary = [| typeof<ArbitraryInteractionListThatEndsDuringTheNight> |])>]
let ``Lights should be red during the night`` (interactions: Interaction list) =
let fakeHome = createFakeHomeWithNightLightAndInteract interactions
fakeHome.ForAllLightsThatAreOn(fun (_, _, color) -> color = Red)