Stop propagating parse errors throughout the tests
This commit is contained in:
parent
109ebde64a
commit
a741938f89
3 changed files with 22 additions and 25 deletions
|
|
@ -2,15 +2,9 @@ module NightLight.Core.Tests.NightLightTests
|
|||
|
||||
open FsCheck.Xunit
|
||||
|
||||
let private assertIsOk (result: Result<unit, 'a>) : unit =
|
||||
match result with
|
||||
| Ok() -> ()
|
||||
| Error error -> failwith $"Expected Ok, got Error {error}"
|
||||
|
||||
[<Property(Arbitrary = [| typeof<Arbitraries> |])>]
|
||||
let ``Brightness should always be under 255`` (fakeHome: FakeHome) (interactions: Interaction list) =
|
||||
interactions
|
||||
|> Seq.iter (fun interaction -> fakeHome.Interact interaction |> assertIsOk)
|
||||
interactions |> Seq.iter (fun interaction -> fakeHome.Interact interaction)
|
||||
|
||||
fakeHome.LightStates
|
||||
|> Seq.choose (fun (_, state) ->
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue