Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: change 'event lists/seq to consistently use arrays #411

Merged
merged 6 commits into from
Jul 26, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Formatting/tidy
  • Loading branch information
bartelink committed Jul 26, 2023
commit 64ef56eb3121fdd877d2513bb322fb351cf07320
4 changes: 2 additions & 2 deletions DOCUMENTATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -1257,7 +1257,7 @@ let validateInterpret contextAndOrArgsAndOrCommand state =
let validateIdempotent contextAndOrArgsAndOrCommand state' =
let events' = interpret contextAndOrArgsAndOrCommand state'
match events' with
| [] -> ()
| [|] -> ()
// TODO add clauses to validate edge cases that should still generate events on a re-run
| xs -> failwithf "Not idempotent; Generated %A in response to %A" xs contextAndOrArgsAndOrCommand
```
Expand Down Expand Up @@ -1853,7 +1853,7 @@ let! res =
eventData
match res with
| AppendResult.Ok -> ()
| c -> failwithf "conflict %A" c
| c -> c |> failwithf "conflict %A"
```
# Access Strategies

Expand Down
2 changes: 1 addition & 1 deletion samples/Store/Domain.Tests/CartTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ let verifyCorrectEventGenerationWhenAppropriate command (originState: State) =
| Events.ItemPropertiesChanged e -> e = { context = e.context; skuId = cSku; waived = value }
| _ -> false)
&& value = (find cSku).returnsWaived.Value @>
| c,e -> failwith $"Invalid result - Command %A{c} yielded Events %A{e} in State %A{state}"
| c, e -> failwith $"Invalid result - Command %A{c} yielded Events %A{e} in State %A{state}"

/// Processing should allow for any given Command to be retried at will, without inducing redundant
/// (and hence potentially-conflicting) changes
Expand Down
2 changes: 1 addition & 1 deletion samples/Store/Domain.Tests/ContactPreferencesTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ let verifyCorrectEventGenerationWhenAppropriate variant command (originState: St
| Update cValue, [||] ->
test <@ state = cValue.preferences
&& state' = state @>
| c,e -> failwith $"Invalid result - Command %A{c} yielded Events %A{e} in State %A{state}"
| c, e -> failwith $"Invalid result - Command %A{c} yielded Events %A{e} in State %A{state}"

/// Processing should allow for any given Command to be retried at will
let verifyIdempotency (cmd: Command) (originState: State) =
Expand Down
2 changes: 1 addition & 1 deletion samples/Store/Domain.Tests/FavoritesTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ let verifyCorrectEventGenerationWhenAppropriate command (originState: State) =
| _ -> false
test <@ skuIds |> List.forall (fun skuId -> hadSkuId skuId || events |> Array.exists (isFavoritingEventFor skuId))
&& skuIds |> List.forall hasSkuId @>
| c,e -> failwith $"Invalid result - Command %A{c} yielded Events %A{e} in State %A{state}"
| c, e -> failwith $"Invalid result - Command %A{c} yielded Events %A{e} in State %A{state}"

/// Processing should allow for any given Command to be retried at will
let verifyIdempotency (command: Command) (originState: State) =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ type Tests(testOutputHelper) =
test <@ match res with
| Choice2Of2 e -> e.Message.StartsWith "Origin event not found; no Archive Container supplied"
|| e.Message.StartsWith "Origin event not found; no Archive Table supplied"
| x -> x |> failwith $"Unexpected %A{x}" @>
| x -> x |> failwithf "Unexpected %A" @>
test <@ [EqxAct.ResponseForward; EqxAct.QueryForward] = capture.ExternalCalls @>
verifyRequestChargesMax 3 // 2.99

Expand Down