< Summary

Information
Class: Elsa.Common.DistributedHosting.DistributedLocks.NoopDistributedLock
Assembly: Elsa.Common
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Common/DistributedHosting/DistributedLocks/Noop/NoopDistributedLock.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 5
Coverable lines: 5
Total lines: 36
Line coverage: 0%
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
TryAcquire(...)100%210%
Acquire(...)100%210%
TryAcquireAsync(...)100%210%
AcquireAsync(...)100%210%
get_Name()100%210%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Common/DistributedHosting/DistributedLocks/Noop/NoopDistributedLock.cs

#LineLine coverage
 1using Medallion.Threading;
 2
 3namespace Elsa.Common.DistributedHosting.DistributedLocks;
 4
 5/// <summary>
 6/// Represents a Noop (No-Operation) implementation of the <see cref="IDistributedLock"/> interface.
 7/// </summary>
 8public class NoopDistributedLock : IDistributedLock
 9{
 10    /// <inheritdoc />
 11    public IDistributedSynchronizationHandle? TryAcquire(TimeSpan timeout = new TimeSpan(), CancellationToken cancellati
 12    {
 013        return new NoopDistributedSynchronizationHandle();
 14    }
 15
 16    /// <inheritdoc />
 17    public IDistributedSynchronizationHandle Acquire(TimeSpan? timeout = null, CancellationToken cancellationToken = new
 18    {
 019        return new NoopDistributedSynchronizationHandle();
 20    }
 21
 22    /// <inheritdoc />
 23    public ValueTask<IDistributedSynchronizationHandle?> TryAcquireAsync(TimeSpan timeout = new TimeSpan(), Cancellation
 24    {
 025        return new ValueTask<IDistributedSynchronizationHandle?>(new NoopDistributedSynchronizationHandle());
 26    }
 27
 28    /// <inheritdoc />
 29    public ValueTask<IDistributedSynchronizationHandle> AcquireAsync(TimeSpan? timeout = null, CancellationToken cancell
 30    {
 031        return new ValueTask<IDistributedSynchronizationHandle>(new NoopDistributedSynchronizationHandle());
 32    }
 33
 34    /// <inheritdoc />
 035    public string Name => "Noop";
 36}