elsa-core/test/unit
RalfvandenBurg c0e37e38d0
Fix/startuptask activate default tenant when empty (#7305)
* fix: activate Tenant.Default when no tenants configured (Option C)

Ensures IStartupTask implementations (e.g., PopulateRegistriesStartupTask,
RunMigrationsStartupTask) run when multitenancy is enabled but the tenant
provider returns an empty list.

- In DefaultTenantService: treat empty provider response as [Tenant.Default]
  in GetTenantsDictionaryAsync (initial load) and RefreshAsync
- Logic is internal to tenant service; no explicit call required

Co-authored-by: Cursor <cursoragent@cursor.com>

* test: add DefaultTenantService tests for empty-provider fallback

- ActivateTenantsAsync_WhenProviderReturnsEmpty_ActivatesDefaultTenant
- ListAsync_WhenProviderReturnsEmpty_ReturnsDefaultTenant
- ActivateTenantsAsync_WhenProviderReturnsTenants_ReturnsThoseTenants
- RefreshAsync_WhenProviderChangesFromTenantsToEmpty_KeepsDefaultTenant

Co-authored-by: Cursor <cursoragent@cursor.com>

* PR feedback disposes serviceprovider also

---------

Co-authored-by: Ralf <Ralf@Careconnections.nl>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-04-11 11:00:12 +02:00
..
Elsa.Activities.UnitTests Configures Flowchart Execution via DI (#7141) 2025-12-15 10:15:39 +01:00
Elsa.Common.UnitTests Fix/startuptask activate default tenant when empty (#7305) 2026-04-11 11:00:12 +02:00
Elsa.Expressions.UnitTests Add code coverage configuration and adjust test projects (#7049) 2025-11-12 13:59:36 +01:00
Elsa.Http.UnitTests Add Elsa Script DSL (#7076) 2025-11-25 19:57:50 +01:00
Elsa.Resilience.Core.UnitTests Enhances distributed lock handling with resilience (#7161) 2025-12-29 19:53:48 +01:00
Elsa.Scheduling.UnitTests Add Elsa Script DSL (#7076) 2025-11-25 19:57:50 +01:00
Elsa.Tenants.UnitTests Fix Multitenancy Support and Normalize Tenant ID Handling (#7217) 2026-01-30 19:54:13 +01:00
Elsa.Workflows.Core.UnitTests Add integration tests for enumerables with projection to arrays (#7290) 2026-02-16 14:09:51 +01:00
Elsa.Workflows.Management.UnitTests Add workflow export functionality and update changelog (#7357) 2026-03-11 17:20:07 +01:00
Elsa.Workflows.Runtime.UnitTests Add idempotency tests for trigger indexing and fix serialization mismatch in WorkflowTriggerEqualityComparer (#7320) 2026-02-25 14:39:23 +01:00
Directory.Build.props Add coverage enforcement for test projects (#6950) 2025-10-07 19:59:53 +02:00