Put Arbitraries on the entire test class
This commit is contained in:
parent
c7c5de9e21
commit
6baf725765
1 changed files with 12 additions and 10 deletions
|
|
@ -1,14 +1,16 @@
|
||||||
module NightLight.Core.Tests.NightLightTests
|
namespace NightLight.Core.Tests
|
||||||
|
|
||||||
open FsCheck.Xunit
|
open FsCheck.Xunit
|
||||||
|
|
||||||
[<Property(Arbitrary = [| typeof<Arbitraries> |])>]
|
[<Properties(Arbitrary = [| typeof<Arbitraries> |])>]
|
||||||
let ``Brightness should always be under 255`` (fakeHome: FakeHome) (interactions: Interaction list) =
|
type NightLightTests() =
|
||||||
interactions |> Seq.iter (fun interaction -> fakeHome.Interact interaction)
|
[<Property>]
|
||||||
|
let ``Brightness should always be under 255`` (fakeHome: FakeHome) (interactions: Interaction list) =
|
||||||
|
interactions |> Seq.iter (fun interaction -> fakeHome.Interact interaction)
|
||||||
|
|
||||||
fakeHome.LightStates
|
fakeHome.LightStates
|
||||||
|> Seq.choose (fun (_, state) ->
|
|> Seq.choose (fun (_, state) ->
|
||||||
match state with
|
match state with
|
||||||
| On brightness -> Some brightness
|
| On brightness -> Some brightness
|
||||||
| Off -> None)
|
| Off -> None)
|
||||||
|> Seq.forall (fun brightness -> brightness < 255uy)
|
|> Seq.forall (fun brightness -> brightness < 255uy)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue