Add project files.

This commit is contained in:
2025-08-18 17:11:43 +03:30
parent 807dc263be
commit e5eb10d604
3943 changed files with 223719 additions and 0 deletions
@@ -0,0 +1,24 @@
using Elsa.Common.Models;
using Elsa.Workflows.ComponentTests.Abstractions;
using Elsa.Workflows.ComponentTests.Fixtures;
using Elsa.Workflows.Management;
using Elsa.Workflows.Management.Filters;
using Microsoft.Extensions.DependencyInjection;
namespace Elsa.Workflows.ComponentTests.Scenarios.Multitenancy;
public class MultitenancyTests(App app) : AppComponentTest(app)
{
[Fact(Skip = "Multitenancy disabled. This test doesn't work because not all workflows are assigned the Tenant1 tenant.")]
public async Task LoadingWorkflows_ShouldReturnWorkflows_FromCurrentTenant()
{
var store = Scope.ServiceProvider.GetRequiredService<IWorkflowDefinitionStore>();
var filter = new WorkflowDefinitionFilter
{
IsSystem = false,
VersionOptions = VersionOptions.Latest
};
var workflows = await store.FindManyAsync(filter);
Assert.All(workflows, workflow => Assert.Equal("Tenant1", workflow.TenantId));
}
}
@@ -0,0 +1,16 @@
using Elsa.Workflows.Activities;
using Hangfire.Annotations;
namespace Elsa.Workflows.ComponentTests.Scenarios.Multitenancy.Workflows;
[UsedImplicitly]
public class WorkflowForTenant1 : WorkflowBase
{
public static readonly string DefinitionId = Guid.NewGuid().ToString();
protected override void Build(IWorkflowBuilder builder)
{
builder.WithDefinitionId(DefinitionId);
builder.WithTenantId("Tenant1");
builder.Root = new WriteLine("Tenant1");
}
}
@@ -0,0 +1,16 @@
using Elsa.Workflows.Activities;
using Hangfire.Annotations;
namespace Elsa.Workflows.ComponentTests.Scenarios.Multitenancy.Workflows;
[UsedImplicitly]
public class WorkflowForTenant2 : WorkflowBase
{
public static readonly string DefinitionId = Guid.NewGuid().ToString();
protected override void Build(IWorkflowBuilder builder)
{
builder.WithDefinitionId(DefinitionId);
builder.WithTenantId("Tenant2");
builder.Root = new WriteLine("Tenant2");
}
}