Add a test for the initial state of the remote-controlled lights
This commit is contained in:
parent
150fa265de
commit
c74238e105
1 changed files with 15 additions and 0 deletions
|
|
@ -71,6 +71,21 @@ type NightLightTests() =
|
|||
|
||||
doesLightHavePowerAfter light interactions = fakeHome.LightShouldHaveState light _.IsOn
|
||||
|
||||
[<Property(Arbitrary = [| typeof<ArbitraryRemotelyControlledLight> |])>]
|
||||
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
|
||||
|
||||
[<Property(Arbitrary = [| typeof<ArbitraryRemotelyControlledLight> |])>]
|
||||
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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue