< Summary

Information
Class: Elsa.Testing.Shared.Services.TestTenantsProvider
Assembly: Elsa.Testing.Shared.Component
File(s): /home/runner/work/elsa-core/elsa-core/src/common/Elsa.Testing.Shared.Component/Services/TestTenantsProvider.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 6
Coverable lines: 6
Total lines: 20
Line coverage: 0%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%210%
ListAsync(...)100%210%
FindAsync()100%210%

File(s)

/home/runner/work/elsa-core/elsa-core/src/common/Elsa.Testing.Shared.Component/Services/TestTenantsProvider.cs

#LineLine coverage
 1using Elsa.Common.Multitenancy;
 2using JetBrains.Annotations;
 3
 4namespace Elsa.Testing.Shared.Services;
 5
 6[UsedImplicitly]
 07public class TestTenantsProvider(params string[] tenantIds) : ITenantsProvider
 8{
 9    public Task<IEnumerable<Tenant>> ListAsync(CancellationToken cancellationToken = default)
 10    {
 011        var tenants = tenantIds.Select(id => new Tenant {Id = id, Name = id});
 012        return Task.FromResult(tenants);
 13    }
 14
 15    public async Task<Tenant?> FindAsync(TenantFilter filter, CancellationToken cancellationToken = default)
 16    {
 017        var query = (await ListAsync(cancellationToken)).AsQueryable();
 018        return filter.Apply(query).FirstOrDefault();
 019    }
 20}