elsa-core/test/unit/Elsa.Workflows.Core.UnitTests
Sipke Schoorstra 1b8083a5c6
Update multitenancy logic and improve Result handling: (#7281)
* Update multitenancy logic and improve `Result` handling:

- Introduce `TenantsOptions` with `IsEnabled` flag to conditionally apply tenant-specific logic.
- Refactor `Result` class to support strongly-typed operations and async handlers.
- Implement tenant filters respecting multitenancy enablement.
- Enhance error logging for workflow definition addition, upgrading error handling.
- Refactor tests and storage drivers to use `IsSuccess` from `Result`.

* Update src/modules/Elsa.Workflows.Runtime/Services/DefaultWorkflowDefinitionStorePopulator.cs

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

* Add exception handling when accessing `Value` on failed results; introduce `ValueOrDefault` property for better null support.

* Add `ThrowIfFailure` method to handle exceptions in `Result` model and use it in `DefaultWorkflowRegistry` to ensure operation success.

* Normalize tenant ID handling by using `NormalizeTenantId()` in `DefaultWorkflowDefinitionStorePopulator`.

* Normalize tenant ID usage in unit tests by returning `tenantId.NormalizeTenantId()` in `DefaultWorkflowDefinitionStorePopulatorTests`.

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-11 10:11:12 +01:00
..
Extensions/ActivityExecutionContextExtensions Feat/unit test coverage sendhttprequest (#6961) 2025-10-20 20:11:46 +02:00
Flowchart Update flowchart activity scheduling, implicit join (and FlowJoin/WaitAll) now only waits for followed connections 2025-02-12 23:27:40 -05:00
Models Fix Multitenancy Support and Normalize Tenant ID Handling (#7217) 2026-01-30 19:54:13 +01:00
ObjectConversion Update multitenancy logic and improve Result handling: (#7281) 2026-02-11 10:11:12 +01:00
Serialization/Converters Bugfix: error thrown in ReadSyntheticInputs 2026-01-20 13:27:55 +01:00
Services Implement null TenantId for tenant-agnostic entities (#7226) 2026-02-02 10:59:01 +01:00
Elsa.Workflows.Core.UnitTests.csproj Add code coverage configuration and adjust test projects (#7049) 2025-11-12 13:59:36 +01:00
ExpressionExecutionContextExtensionsTests.cs Fix SetVariable test (#6656) 2025-05-20 11:52:57 +02:00