Skip to content

Commit ffd3857

Browse files
committed
Update README.md
Signed-off-by: Daan Schutte <daan.schutte@icloud.com>
1 parent 8426577 commit ffd3857

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

examples/Workflow/README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,25 @@ The `OrderProcessingWorkflow.cs` in `Workflows` directory implements the running
3030

3131
This sample also contains a [WorkflowUnitTest](./WorkflowUnitTest) .NET project that utilizes [xUnit](https://xunit.net/) and [Moq](https://github.com/moq/moq) to test the workflow logic.
3232
It works by creating an instance of the `OrderProcessingWorkflow` (defined in the `WorkflowConsoleApp` project), mocking activity calls, and testing the inputs and outputs.
33-
The tests also verify that outputs of the workflow.
33+
The tests verify the outputs of the workflow without requiring a Dapr sidecar, since the `WorkflowContext` itself is mocked.
34+
35+
### Test scenarios
36+
37+
| Test | Concept |
38+
|------|---------|
39+
| `TestSuccessfulOrder` | Mock activity calls, verify inputs and call counts |
40+
| `TestHighCostOrderApproved` | Mock external events (`WaitForExternalEventAsync`) and verify custom status |
41+
| `TestHighCostOrderApprovalTimeout` | Simulate timeouts with `TaskCanceledException` |
42+
| `TestInsufficientInventory` | Branch on activity return value, verify early termination |
43+
| `TestActivityException` | Simulate activity failures with `WorkflowTaskFailedException` |
44+
45+
### Running unit tests
46+
47+
No Dapr sidecar is required. From the repository root:
48+
49+
```sh
50+
dotnet test examples/Workflow/WorkflowUnitTest
51+
```
3452

3553
## Running the console app example
3654

0 commit comments

Comments
 (0)