From e5141d528eec1e6f8c34efcb7d1eb1bac64ca7aa Mon Sep 17 00:00:00 2001 From: Sven van Heugten Date: Sun, 18 Jan 2026 07:07:22 +0100 Subject: [PATCH] Label properties with the state of FakeHome --- NightLight.Core.Tests/FakeHome.fs | 5 +++++ NightLight.Core.Tests/NightLightTests.fs | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/NightLight.Core.Tests/FakeHome.fs b/NightLight.Core.Tests/FakeHome.fs index bec7bb6..3c2471a 100644 --- a/NightLight.Core.Tests/FakeHome.fs +++ b/NightLight.Core.Tests/FakeHome.fs @@ -156,3 +156,8 @@ type FakeHome with this.LightStates |> Seq.filter (fst >> _.ControlledWithRemote >> (<>) NonRemote) |> Seq.toList + + member this.Label = + this.LightsThatAreOn + |> Seq.map (fun (light, state) -> $"{light.FriendlyName.Get}: {state}") + |> String.concat ", " diff --git a/NightLight.Core.Tests/NightLightTests.fs b/NightLight.Core.Tests/NightLightTests.fs index 376e86c..e7bd636 100644 --- a/NightLight.Core.Tests/NightLightTests.fs +++ b/NightLight.Core.Tests/NightLightTests.fs @@ -38,6 +38,7 @@ type NightLightTests() = | Night -> color = Red) |> Prop.collect partOfDay |> Prop.collect $"{fakeHome.LightsThatAreOn.Length} light(s) on" + |> Prop.label fakeHome.Label |> Prop.trivial (fakeHome.LightsThatAreOn.Length = 0) [ |])>] @@ -55,6 +56,7 @@ type NightLightTests() = | { Bulb = PaulmannBulb }, On(80uy, Red) -> true | _ -> false) |> Prop.collect $"{fakeHome.LightsThatAreOn.Length} light(s) on" + |> Prop.label fakeHome.Label |> Prop.trivial (fakeHome.LightsThatAreOn.Length = 0) [ |])>] @@ -69,6 +71,7 @@ type NightLightTests() = nonRemotelyControlledLightsWithPower |> Seq.forall (snd >> _.IsOn) |> Prop.collect $"{nonRemotelyControlledLightsWithPower.Length} non-remotely controlled light(s) with power" + |> Prop.label fakeHome.Label |> Prop.trivial (nonRemotelyControlledLightsWithPower.Length = 0) [ |])>] @@ -104,4 +107,5 @@ type NightLightTests() = |> Prop.collect $"last remote interaction is {maybeLastRemoteInteraction |> Option.map snd}" |> Prop.collect $"{remotelyControlledLightsWithPower.Length} remotely controlled light(s) with power" |> Prop.classify hasNewDayStartedSinceThen "new day has started since then" + |> Prop.label fakeHome.Label |> Prop.trivial (remotelyControlledLightsWithPower.Length = 0)