From 8441e797a74e25581110928f1bbd1a24612f83ac Mon Sep 17 00:00:00 2001 From: Ruben Bartelink Date: Thu, 16 Nov 2023 16:20:34 +0000 Subject: [PATCH] Tidy --- samples/Store/Domain.Tests/LightTests.fs | 4 ++-- samples/Store/Domain/Light.fs | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/samples/Store/Domain.Tests/LightTests.fs b/samples/Store/Domain.Tests/LightTests.fs index 0415859be..f1dc9d637 100644 --- a/samples/Store/Domain.Tests/LightTests.fs +++ b/samples/Store/Domain.Tests/LightTests.fs @@ -3,7 +3,7 @@ module Domain.Tests.LightTests open Domain.Light open Swensen.Unquote -type Cases = Off | On | After3Cycles +type Case = Off | On | After3Cycles let establish = function | Off -> initial | On -> fold initial [| SwitchedOn |] @@ -24,4 +24,4 @@ let [] props case cmd = | After3Cycles, true -> events =! [| Broke |] | After3Cycles, false -> events =! [||] - [||] = decideSwitch cmd state // all commands are idempotent + [||] =! decideSwitch cmd state // all commands are idempotent diff --git a/samples/Store/Domain/Light.fs b/samples/Store/Domain/Light.fs index 6ce6ef4f9..6862cfe64 100644 --- a/samples/Store/Domain/Light.fs +++ b/samples/Store/Domain/Light.fs @@ -1,8 +1,7 @@ +/// By Jérémie Chassaing / @thinkb4coding +/// https://github.com/dddeu/dddeu20-talks-jeremie-chassaing-functional-event-sourcing/blob/main/EventSourcing.fsx#L52-L84 module Domain.Light -// By Jérémie Chassaing / @thinkb4coding -// https://github.com/dddeu/dddeu20-talks-jeremie-chassaing-functional-event-sourcing/blob/main/EventSourcing.fsx#L52-L84 - type Event = | SwitchedOn | SwitchedOff @@ -12,7 +11,7 @@ type State = | Broken and CurrentState = { on: bool; remainingUses: int } let initial = Working { on = false; remainingUses = 3 } -let evolve s e = +let private evolve s e = match s with | Broken -> s | Working s ->