Get rid of arbitraries that are only used once
This commit is contained in:
parent
7472825140
commit
bb528e9942
5 changed files with 40 additions and 40 deletions
20
NightLight.Core.Tests/TimeChangedGenerators.fs
Normal file
20
NightLight.Core.Tests/TimeChangedGenerators.fs
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
module NightLight.Core.Tests.TimeChangedGenerators
|
||||
|
||||
open System
|
||||
open FsCheck.FSharp
|
||||
|
||||
let private isDay (time: DateTime) =
|
||||
time.TimeOfDay >= TimeSpan.FromHours 5.5
|
||||
&& time.TimeOfDay < TimeSpan.FromHours 20.5
|
||||
|
||||
let genTimeChangedToDay =
|
||||
ArbMap.defaults
|
||||
|> ArbMap.generate<DateTime>
|
||||
|> Gen.filter isDay
|
||||
|> Gen.map Interaction.TimeChanged
|
||||
|
||||
let genTimeChangedToNight =
|
||||
ArbMap.defaults
|
||||
|> ArbMap.generate<DateTime>
|
||||
|> Gen.filter (not << isDay)
|
||||
|> Gen.map Interaction.TimeChanged
|
||||
Loading…
Add table
Add a link
Reference in a new issue