elsa-core/test
Sipke Schoorstra a3278ccf97
Add BulkDispatchWorkflows tests and improve activity coverage (#7026)
* Refactor BulkDispatchWorkflows tests and improve activity coverage

- Migrate `BulkDispatchWorkflows` tests to a new structure under `Scenarios/BulkDispatch`.
- Introduce comprehensive test cases for bulk dispatch scenarios, including empty items, correlation IDs, child ports, dictionary items, and invalid definitions.
- Add multiple reusable workflows such as `BulkChildWorkflow`, `BulkDispatchAndWaitWorkflow`, and `BulkDispatchFireAndForgetWorkflow` for enhanced test coverage.
- Update namespaces and project files to reflect the restructuring and new workflow definitions.
- Enhance functionality for `IWorkflowInstanceVariableManager` by adding methods for variable retrieval from workflow states and instances.

* Add additional assertions for WriteLine activity tests and update workflow builder in BulkDispatch tests

- Enhanced `BulkDispatchWorkflowsTests` by validating written texts for accuracy.
- Refactored `BulkDispatchFireAndForgetWorkflow` to update activity and namespace references.

* Add `SlowBulkChildWorkflow` and update `BulkDispatchFireAndForgetWorkflow` test structure

- Introduced `SlowBulkChildWorkflow` with a delay and logging functionality for bulk dispatch testing.
- Modified `BulkDispatchFireAndForgetWorkflow` to use `SlowBulkChildWorkflow` and updated test items.
- Enhanced `BulkDispatchWorkflowsTests` with child workflow completion validation and timing assertions.

* Refactor BulkDispatch tests by removing dictionary item workflow and streamlining child workflow handling

- Removed `BulkDispatchWithDictionaryItemsWorkflow` and associated test cases.
- Updated `BulkChildWorkflow` to use input binding.
- Streamlined child workflow event handling in `BulkDispatchWorkflowsTests` using a reusable helper method.
- Enhanced `CorrelationIdFunction` support with JavaScript expression handling.

* Move unit test workflows to `Scenarios/Activities` and update namespace references

- Relocated all test workflows from `Scenarios/BulkDispatch` and `Scenarios/ExecuteWorkflows` to `Scenarios/Activities`.
- Updated namespaces and imports to reflect the new folder structure.

* Refactor BulkDispatch and FlowJoin test workflows:

- Moved `BulkDispatch` workflows to `Scenarios/Activities/BulkDispatchWorkflows`.
- Renamed `FlowJoins` to `FlowJoin` and updated namespaces to match.
- Adjusted imports and references to align with new folder structure and updated class definitions.

* Remove unused folder reference from `Elsa.Workflows.ComponentTests.csproj`.

* Update test/component/Elsa.Workflows.ComponentTests/Scenarios/Activities/BulkDispatchWorkflows/BulkDispatchWorkflowsTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-11-04 15:44:44 +01:00
..
component Add BulkDispatchWorkflows tests and improve activity coverage (#7026) 2025-11-04 15:44:44 +01:00
integration Adds ExecuteWorkflow activity tests (#7003) 2025-10-31 18:57:45 +01:00
performance Add coverage enforcement for test projects (#6950) 2025-10-07 19:59:53 +02:00
unit Adds ExecuteWorkflow activity tests (#7003) 2025-10-31 18:57:45 +01:00
Directory.Build.props Add coverage enforcement for test projects (#6950) 2025-10-07 19:59:53 +02:00