Skip to content

Commit

Permalink
readme.md updated - test example added
Browse files Browse the repository at this point in the history
  • Loading branch information
idugalic committed Jan 29, 2025
1 parent eb33e1d commit 2951762
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,19 @@ Find the documentation at [https://docs.rs/fmodel-rust/latest/fmodel_rust/](http
- When `< an action/trigger occurs / commands>`
- Then `< some post condition / events >`

```rust
DeciderTestSpecification::default()
.for_decider(self::order_decider()) // Set the decider
.given(vec![]) // no existing events
.when(create_order_command.clone()) // Create an Order
.then(vec![OrderEvent::Created(OrderCreated {
identifier: identifier.clone(),
restaurant_identifier: restaurant_identifier.clone(),
status: OrderStatus::Created,
line_items: line_items.clone(),
})]);
```

## Fstore-SQL

This project is using [PostgreSQL powered event store](https://github.com/fraktalio/fstore-sql), optimized for event
Expand Down

0 comments on commit 2951762

Please sign in to comment.