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
|
||||
|
||||
[<Property(Arbitrary = [| typeof<Arbitraries> |])>]
|
||||
let ``Brightness should always be under 255`` (fakeHome: FakeHome) (interactions: Interaction list) =
|
||||
interactions |> Seq.iter (fun interaction -> fakeHome.Interact interaction)
|
||||
[<Properties(Arbitrary = [| typeof<Arbitraries> |])>]
|
||||
type NightLightTests() =
|
||||
[<Property>]
|
||||
let ``Brightness should always be under 255`` (fakeHome: FakeHome) (interactions: Interaction list) =
|
||||
interactions |> Seq.iter (fun interaction -> fakeHome.Interact interaction)
|
||||
|
||||
fakeHome.LightStates
|
||||
|> Seq.choose (fun (_, state) ->
|
||||
match state with
|
||||
| On brightness -> Some brightness
|
||||
| Off -> None)
|
||||
|> Seq.forall (fun brightness -> brightness < 255uy)
|
||||
fakeHome.LightStates
|
||||
|> Seq.choose (fun (_, state) ->
|
||||
match state with
|
||||
| On brightness -> Some brightness
|
||||
| Off -> None)
|
||||
|> Seq.forall (fun brightness -> brightness < 255uy)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue