< Summary

Information
Class: Elsa.Common.Multitenancy.EventHandlers.RunStartupTasks
Assembly: Elsa.Common
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Common/Multitenancy/EventHandlers/RunStartupTasks.cs
Line coverage
100%
Covered lines: 7
Uncovered lines: 0
Coverable lines: 7
Total lines: 19
Line coverage: 100%
Branch coverage
100%
Covered branches: 4
Total branches: 4
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
TenantActivatedAsync()100%22100%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Common/Multitenancy/EventHandlers/RunStartupTasks.cs

#LineLine coverage
 1using System.Reflection;
 2using Elsa.Common.RecurringTasks;
 3using Microsoft.Extensions.DependencyInjection;
 4
 5namespace Elsa.Common.Multitenancy.EventHandlers;
 6
 7public class RunStartupTasks : ITenantActivatedEvent
 8{
 9    public async Task TenantActivatedAsync(TenantActivatedEventArgs args)
 10    {
 111        var cancellationToken = args.CancellationToken;
 112        var tenantScope = args.TenantScope;
 1013        var tasks = tenantScope.ServiceProvider.GetServices<IStartupTask>().OrderBy(x => x.GetType().GetCustomAttribute<
 114        var taskExecutor = tenantScope.ServiceProvider.GetRequiredService<ITaskExecutor>();
 15
 2016        foreach (var task in tasks)
 917            await taskExecutor.ExecuteTaskAsync(task, cancellationToken);
 118    }
 19}

Methods/Properties

TenantActivatedAsync()