Skip to content

Commit

Permalink
Tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
bartelink committed Dec 15, 2023
1 parent fed3cbf commit 8441e79
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions samples/Store/Domain.Tests/LightTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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 |]
Expand All @@ -24,4 +24,4 @@ let [<FsCheck.Xunit.Property>] props case cmd =
| After3Cycles, true -> events =! [| Broke |]
| After3Cycles, false -> events =! [||]

[||] = decideSwitch cmd state // all commands are idempotent
[||] =! decideSwitch cmd state // all commands are idempotent
7 changes: 3 additions & 4 deletions samples/Store/Domain/Light.fs
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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 ->
Expand Down

0 comments on commit 8441e79

Please sign in to comment.