diff --git a/NightLight.Core.Tests/NightLightTests.fs b/NightLight.Core.Tests/NightLightTests.fs index 935f4c6..35ec4cf 100644 --- a/NightLight.Core.Tests/NightLightTests.fs +++ b/NightLight.Core.Tests/NightLightTests.fs @@ -71,6 +71,21 @@ type NightLightTests() = doesLightHavePowerAfter light interactions = fakeHome.LightShouldHaveState light _.IsOn + [ |])>] + let ``All remote controlled lights with power should be on if the 'Off' button on the remote was never pressed`` + (light: Light) + = + concatGens + [ genTimeChanged |> Gen.map List.singleton + genInteractionsExcept light ((=) (HumanInteraction RemotePressedOffButton)) ] + |> Arb.fromGen + |> Prop.forAll + <| fun interactions -> + let fakeHome = createFakeHomeWithNightLightAndInteract interactions + + doesLightHavePowerAfter light interactions + ==> fakeHome.LightShouldHaveState light _.IsOn + [ |])>] let ``After pressing 'On' on the remote, if the 'Off' button isn't pressed, all remotely controlled lights with power should be on`` (light: Light)