< Summary

Information
Class: Elsa.ExternalAuthentication.Stores.InMemory.InMemoryConnectionRegistryVersionStore
Assembly: Elsa.ExternalAuthentication
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.ExternalAuthentication/Stores/InMemory/InMemoryConnectionRegistryVersionStore.cs
Line coverage
100%
Covered lines: 7
Uncovered lines: 0
Coverable lines: 7
Total lines: 26
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
.ctor()100%11100%
GetVersionAsync(...)100%11100%
AdvanceAsync(...)100%11100%
IsCurrentAsync(...)100%11100%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.ExternalAuthentication/Stores/InMemory/InMemoryConnectionRegistryVersionStore.cs

#LineLine coverage
 1using Elsa.ExternalAuthentication.Contracts;
 2
 3namespace Elsa.ExternalAuthentication.Stores.InMemory;
 4
 5public sealed class InMemoryConnectionRegistryVersionStore : IConnectionRegistryVersionStore
 6{
 307    private long _version = 1;
 8
 9    public ValueTask<long> GetVersionAsync(CancellationToken cancellationToken = default)
 10    {
 311        cancellationToken.ThrowIfCancellationRequested();
 312        return ValueTask.FromResult(Interlocked.Read(ref _version));
 13    }
 14
 15    public ValueTask<long> AdvanceAsync(CancellationToken cancellationToken = default)
 16    {
 2517        cancellationToken.ThrowIfCancellationRequested();
 2518        return ValueTask.FromResult(Interlocked.Increment(ref _version));
 19    }
 20
 21    public ValueTask<bool> IsCurrentAsync(long version, CancellationToken cancellationToken = default)
 22    {
 323        cancellationToken.ThrowIfCancellationRequested();
 324        return ValueTask.FromResult(Interlocked.Read(ref _version) == version);
 25    }
 26}