< Summary

Information
Class: Elsa.Secrets.Services.SecretStoreRegistry
Assembly: Elsa.Secrets
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Secrets/Services/SecretStoreRegistry.cs
Line coverage
100%
Covered lines: 7
Uncovered lines: 0
Coverable lines: 7
Total lines: 18
Line coverage: 100%
Branch coverage
100%
Covered branches: 2
Total branches: 2
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%11100%
List()100%11100%
Get(...)100%22100%
TryGet(...)100%11100%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Secrets/Services/SecretStoreRegistry.cs

#LineLine coverage
 1namespace Elsa.Secrets.Services;
 2
 313public class SecretStoreRegistry(IEnumerable<ISecretStore> stores) : ISecretStoreRegistry
 4{
 1095    private readonly Lazy<Dictionary<string, ISecretStore>> _stores = new(() => stores.ToDictionary(x => x.Name, StringC
 6
 27    public IReadOnlyCollection<ISecretStore> List() => _stores.Value.Values.ToList();
 8
 9    public ISecretStore Get(string name)
 10    {
 4711        if (TryGet(name, out var store))
 4612            return store!;
 13
 114        throw new InvalidOperationException($"Secret store '{name}' is not registered.");
 15    }
 16
 4717    public bool TryGet(string name, out ISecretStore? store) => _stores.Value.TryGetValue(name, out store);
 18}