You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: examples/Workflow/README.md
+19-1Lines changed: 19 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,7 +30,25 @@ The `OrderProcessingWorkflow.cs` in `Workflows` directory implements the running
30
30
31
31
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.
32
32
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:
0 commit comments