Make tests target specific lights when testing

This commit is contained in:
Sven van Heugten 2026-01-08 21:33:30 +01:00
parent 0ddcd17fd4
commit d57ca23822
5 changed files with 72 additions and 74 deletions

View file

@ -135,15 +135,5 @@ type FakeHome() =
type FakeHome with
member this.Interact(interactions: Interaction seq) = interactions |> Seq.iter this.Interact
member this.ForAllLightsThatAreOn condition =
this.LightStates
|> Seq.choose (fun (light, state) ->
match state with
| On(brightness, color) -> Some(light, brightness, color)
| Off -> None)
|> Seq.forall condition
member this.ForAllRemotelyControlledLights condition =
this.LightStates
|> Seq.filter (fst >> _.ControlledWithRemote)
|> Seq.forall condition
member this.LightShouldHaveState light condition =
this.LightStates |> Seq.find (fst >> (=) light) |> snd |> condition