< Summary

Information
Class: Elsa.Workflows.RandomLongIdentityGenerator
Assembly: Elsa.Workflows.Core
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Core/Services/RandomLongIdentityGenerator.cs
Line coverage
100%
Covered lines: 4
Uncovered lines: 0
Coverable lines: 4
Total lines: 18
Line coverage: 100%
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
GenerateId()100%11100%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Core/Services/RandomLongIdentityGenerator.cs

#LineLine coverage
 1using System.Security.Cryptography;
 2
 3namespace Elsa.Workflows;
 4
 5/// <summary>
 6/// Generates a unique identifier using a random long value.
 7/// </summary>
 8public class RandomLongIdentityGenerator : IIdentityGenerator
 9{
 10    /// <inheritdoc />
 11    public string GenerateId()
 12    {
 968613        var bytes = new byte[8];
 968614        RandomNumberGenerator.Fill(bytes);
 968615        var randomLong = BitConverter.ToInt64(bytes, 0);
 968616        return randomLong.ToString("x");
 17    }
 18}

Methods/Properties

GenerateId()