Simplify tests to prepare for a more complicated remote
This commit is contained in:
parent
a4b11e1ffa
commit
6ecb6d07ac
3 changed files with 24 additions and 26 deletions
|
|
@ -6,16 +6,14 @@ open NightLight.Core.Tests.TimeChangedGenerators
|
|||
open FsCheck
|
||||
|
||||
let private genHumanInteraction biasTowardsLight =
|
||||
let genLightInteraction =
|
||||
Gen.oneof [ Gen.constant biasTowardsLight; Gen.elements lights ]
|
||||
|> Gen.bind (fun light -> Gen.elements [ LightPoweredOn light; LightPoweredOff light ])
|
||||
|
||||
let genRemoteInteraction =
|
||||
Gen.elements [ RemotePressedOnButton; RemotePressedOffButton ]
|
||||
|
||||
Gen.oneof [ genLightInteraction; genRemoteInteraction ]
|
||||
Gen.oneof [ Gen.constant biasTowardsLight; Gen.elements lights ]
|
||||
|> Gen.bind (fun light -> Gen.elements [ LightPoweredOn light; LightPoweredOff light ])
|
||||
|> Gen.map Interaction.HumanInteraction
|
||||
|
||||
let private genRemoteInteraction =
|
||||
Gen.elements [ RemotePressedOnButton; RemotePressedOffButton ]
|
||||
|> Gen.map RemoteInteraction
|
||||
|
||||
let private genInteraction biasTowardsLight =
|
||||
Gen.oneof [ genTimeChanged; genHumanInteraction biasTowardsLight ]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue