< Summary

Information
Class: LeetCode.Tests.Base.Scenarios.VoidOperationResult
Assembly: LeetCode.Tests.Base
File(s): D:\a\LeetCode-CS\LeetCode-CS\source\Tests\LeetCode.Tests.Base\Scenarios\VoidOperationResult.cs
Line coverage
40%
Covered lines: 4
Uncovered lines: 6
Coverable lines: 10
Total lines: 47
Line coverage: 40%
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
.cctor()100%11100%
.ctor()100%11100%
Equals(...)100%210%
GetHashCode()100%210%

File(s)

D:\a\LeetCode-CS\LeetCode-CS\source\Tests\LeetCode.Tests.Base\Scenarios\VoidOperationResult.cs

#LineLine coverage
 1// --------------------------------------------------------------------------------
 2// Copyright (C) 2026 Eugene Eremeev (also known as Yevhenii Yeriemeieiv).
 3// All Rights Reserved.
 4// --------------------------------------------------------------------------------
 5// This software is the confidential and proprietary information of Eugene Eremeev
 6// (also known as Yevhenii Yeriemeieiv) ("Confidential Information"). You shall not
 7// disclose such Confidential Information and shall use it only in accordance with
 8// the terms of the license agreement you entered into with Eugene Eremeev (also
 9// known as Yevhenii Yeriemeieiv).
 10// --------------------------------------------------------------------------------
 11
 12namespace LeetCode.Tests.Base.Scenarios;
 13
 14/// <summary>
 15///     Represents an operation result for operations that do not return a value.
 16///     Implements the Singleton pattern to avoid unnecessary allocations.
 17/// </summary>
 18public sealed class VoidOperationResult : IOperationResult
 19{
 20    /// <summary>
 21    ///     Gets the single shared instance of <see cref="VoidOperationResult" />.
 22    /// </summary>
 123    public static readonly VoidOperationResult Instance = new();
 24
 125    private VoidOperationResult()
 126    {
 127    }
 28
 29    /// <inheritdoc />
 30    /// <remarks>
 31    ///     Two <see cref="VoidOperationResult" /> instances are always considered equal
 32    ///     because the type carries no state.
 33    /// </remarks>
 34    public override bool Equals(object? obj)
 035    {
 036        return obj is VoidOperationResult;
 037    }
 38
 39    /// <inheritdoc />
 40    /// <remarks>
 41    ///     Returns a constant hash code of <c>0</c> since all instances are equivalent.
 42    /// </remarks>
 43    public override int GetHashCode()
 044    {
 045        return 0;
 046    }
 47}