elsa-core/src
Sipke Schoorstra 66543a48b0
Add integration tests for WorkflowDefinitionActivity scenarios (#6999)
* Add unit tests for `FlowFork` activity and enhance test utilities

- Introduce `FlowForkTests` to validate activity behavior with various branch configurations.
- Extend `ActivityExecutionContextExtensions` with methods to retrieve and check outcomes.
- Modify `ActivityTestFixture` to ensure activities transition to `Running` status before execution.

* Add unit tests for `FlowSwitch` activity and extend test utilities

- Implement `FlowSwitchTests` to verify behavior based on switch cases, modes, and literal expressions.
- Enhance `ActivityExecutionContextExtensions` with methods to retrieve and check outcomes in execution context.

* Update test guidelines to include examples for checking activity outcomes

- Add unit test examples for validating multiple and default outcomes.
- Extend documentation to describe new `ActivityExecutionContextExtensions` methods: `GetOutcomes` and `HasOutcome`.

* Apply suggestion from @Copilot

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

* Simplify `GetOutcomes` method in `ActivityExecutionContextExtensions`.

* Add unit tests for `FlowSendHttpRequest` activity and refactor helper utilities

- Introduce `FlowSendHttpRequestTests` to validate activity behavior across various scenarios.
- Add utility methods in `SendHttpRequestTestHelpers` for creating mock responses and exceptions.
- Refactor `Helpers` namespace to `Http.Helpers` for better organization.
- Update project file to reflect namespace adjustments.

* Update test/unit/Elsa.Activities.UnitTests/Elsa.Activities.UnitTests.csproj

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

* Add integration tests for WorkflowDefinitionActivity scenarios

- Introduce integration tests covering inputs, outputs, version fallback, and outcome handling.
- Add JSON workflow definitions to validate parent-child workflow execution.
- Update project files to include new test scenarios.
- Enhance error handling in `RunWorkflowExtensions` for missing workflow definitions.
- Adjust JavaScript expression handler to support PascalCase activity names.

* Refactor WorkflowDefinitionActivity tests to use Theory with dynamic test cases

- Consolidate multiple Fact-based tests into a single parameterized Theory.
- Introduce `WorkflowDefinitionActivityTestCases` for reusable test scenarios.
- Simplify assertions and improve test structure for better maintainability.

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-10-21 15:37:10 +02:00
..
apps Reverting wrong commits 2025-10-09 14:36:56 +02:00
clients/Elsa.Api.Client Refactor flowchart token handling and enhance merge mode behavior (#6937) 2025-10-01 15:01:33 +02:00
common Add integration tests for WorkflowDefinitionActivity scenarios (#6999) 2025-10-21 15:37:10 +02:00
extensions/Elsa.Testing.Extensions Fix ASP.NET integration test crashes by adding proper Elsa background task shutdown (#6686) 2025-05-24 23:25:37 +02:00
modules Add integration tests for WorkflowDefinitionActivity scenarios (#6999) 2025-10-21 15:37:10 +02:00
samples Fix ASP.NET integration test crashes by adding proper Elsa background task shutdown (#6686) 2025-05-24 23:25:37 +02:00
Directory.Build.props Refactor projects to target .NET 8.0 exclusively. 2025-02-24 22:29:51 +01:00