< Summary

Information
Class: Elsa.Identity.Services.DefaultRandomStringGenerator
Assembly: Elsa.Identity
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Identity/Services/DefaultRandomStringGenerator.cs
Line coverage
100%
Covered lines: 2
Uncovered lines: 0
Coverable lines: 2
Total lines: 16
Line coverage: 100%
Branch coverage
50%
Covered branches: 1
Total branches: 2
Branch coverage: 50%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
Generate(...)50%22100%

File(s)

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

#LineLine coverage
 1using System.Security.Cryptography;
 2using Elsa.Identity.Constants;
 3using Elsa.Identity.Contracts;
 4
 5namespace Elsa.Identity.Services;
 6
 7/// <inheritdoc />
 8public class DefaultRandomStringGenerator : IRandomStringGenerator
 9{
 10    /// <inheritdoc />
 11    public string Generate(int length = 32, char[]? chars = null)
 12    {
 113        chars ??= CharacterSequences.AlphanumericSequence;
 114        return RandomNumberGenerator.GetString(chars, length);
 15    }
 16}