Add some mutannot mutations
This commit is contained in:
parent
eaae9fe9b8
commit
56ef751145
1 changed files with 4 additions and 0 deletions
|
|
@ -1,5 +1,6 @@
|
||||||
namespace NightLight.Core.Tests
|
namespace NightLight.Core.Tests
|
||||||
|
|
||||||
|
open Mutannot
|
||||||
open NightLight.Core.Core
|
open NightLight.Core.Core
|
||||||
open NightLight.Core.Tests.InteractionListGenerators
|
open NightLight.Core.Tests.InteractionListGenerators
|
||||||
open NightLight.Core.Tests.InteractionListHelpers
|
open NightLight.Core.Tests.InteractionListHelpers
|
||||||
|
|
@ -31,6 +32,7 @@ type NightLightTests() =
|
||||||
fakeHome
|
fakeHome
|
||||||
|
|
||||||
[<Property(Arbitrary = [| typeof<ArbitraryInteractions> |])>]
|
[<Property(Arbitrary = [| typeof<ArbitraryInteractions> |])>]
|
||||||
|
[<MutationCase("all-lights-right-color-night-is-yellow", "NightLight.Core/Moods.fs", 16, "Red", "Yellow")>]
|
||||||
let ``All lights should either be off or have the right color`` (interactions: Interaction list) =
|
let ``All lights should either be off or have the right color`` (interactions: Interaction list) =
|
||||||
let fakeHome = createFakeHomeWithNightLightAndInteract interactions
|
let fakeHome = createFakeHomeWithNightLightAndInteract interactions
|
||||||
let partOfDay = getPartOfDayAfterInteractions interactions
|
let partOfDay = getPartOfDayAfterInteractions interactions
|
||||||
|
|
@ -48,6 +50,7 @@ type NightLightTests() =
|
||||||
|> Prop.trivial (fakeHome.LightsThatAreOn.Length = 0)
|
|> Prop.trivial (fakeHome.LightsThatAreOn.Length = 0)
|
||||||
|
|
||||||
[<Property(Arbitrary = [| typeof<ArbitraryInteractions> |], MaxTest = 500)>]
|
[<Property(Arbitrary = [| typeof<ArbitraryInteractions> |], MaxTest = 500)>]
|
||||||
|
[<MutationCase("brightness-command-off-by-one", "NightLight.Core/ZigbeeCommands.fs", 40, "Brightness b -> b", "Brightness b -> b + 1")>]
|
||||||
let ``All lights should either be off or have a brightness that fits its color`` (interactions: Interaction list) =
|
let ``All lights should either be off or have a brightness that fits its color`` (interactions: Interaction list) =
|
||||||
let fakeHome = createFakeHomeWithNightLightAndInteract interactions
|
let fakeHome = createFakeHomeWithNightLightAndInteract interactions
|
||||||
let time = getTimeAfterInteractions interactions |> _.TimeOfDay
|
let time = getTimeAfterInteractions interactions |> _.TimeOfDay
|
||||||
|
|
@ -88,6 +91,7 @@ type NightLightTests() =
|
||||||
|> Prop.trivial (fakeHome.LightsThatAreOn.Length = 0)
|
|> Prop.trivial (fakeHome.LightsThatAreOn.Length = 0)
|
||||||
|
|
||||||
[<Property(Arbitrary = [| typeof<ArbitraryInteractions> |], MaxTest = 500)>]
|
[<Property(Arbitrary = [| typeof<ArbitraryInteractions> |], MaxTest = 500)>]
|
||||||
|
[<MutationCase("lights-default-to-off", "NightLight.Core/NightLightStateMachine.fs", 145, "light, On", "light, Off")>]
|
||||||
let ``All lights with power should have the correct state`` (interactions: Interaction list) =
|
let ``All lights with power should have the correct state`` (interactions: Interaction list) =
|
||||||
let fakeHome = createFakeHomeWithNightLightAndInteract interactions
|
let fakeHome = createFakeHomeWithNightLightAndInteract interactions
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue