< Summary

Information
Class: Elsa.Identity.Services.DefaultSecretGenerator
Assembly: Elsa.Identity
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Identity/Services/DefaultSecretGenerator.cs
Line coverage
75%
Covered lines: 3
Uncovered lines: 1
Coverable lines: 4
Total lines: 22
Line coverage: 75%
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%11100%
Generate(...)100%210%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Identity/Services/DefaultSecretGenerator.cs

#LineLine coverage
 1using Elsa.Identity.Constants;
 2using Elsa.Identity.Contracts;
 3
 4namespace Elsa.Identity.Services;
 5
 6/// <inheritdoc />
 7public class DefaultSecretGenerator : ISecretGenerator
 8{
 9    private readonly IRandomStringGenerator _randomStringGenerator;
 10
 11    /// <summary>
 12    /// Initializes a new instance of the <see cref="DefaultSecretGenerator"/> class.
 13    /// </summary>
 14    /// <param name="randomStringGenerator"></param>
 115    public DefaultSecretGenerator(IRandomStringGenerator randomStringGenerator)
 16    {
 117        _randomStringGenerator = randomStringGenerator;
 118    }
 19
 20    /// <inheritdoc />
 021    public string Generate(int length = 32) => _randomStringGenerator.Generate(length, CharacterSequences.AlphanumericAn
 22}