< Summary

Information
Class: LeetCode.Algorithms.RomanToInteger.Iterative.RomanSymbol
Assembly: LeetCode
File(s): D:\a\LeetCode-CS\LeetCode-CS\source\LeetCode\Algorithms\RomanToInteger\Iterative\RomanSymbol.cs
Line coverage
37%
Covered lines: 9
Uncovered lines: 15
Coverable lines: 24
Total lines: 50
Line coverage: 37.5%
Branch coverage
0%
Covered branches: 0
Total branches: 2
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%11100%
get_Char()100%11100%
get_I()100%11100%
get_V()100%11100%
get_X()100%11100%
get_L()100%11100%
get_C()100%11100%
get_D()100%11100%
get_M()100%11100%
ToString()100%210%
Equals(...)0%620%
Equals(...)100%210%
GetHashCode()100%210%

File(s)

D:\a\LeetCode-CS\LeetCode-CS\source\LeetCode\Algorithms\RomanToInteger\Iterative\RomanSymbol.cs

#LineLine coverage
 1// --------------------------------------------------------------------------------
 2// Copyright (C) 2025 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.Algorithms.RomanToInteger.Iterative;
 13
 1914internal class RomanSymbol(char @char)
 15{
 11816    public char Char { get; } = @char;
 17
 318    public static RomanSymbol I => new(RomanChars.I);
 219    public static RomanSymbol V => new(RomanChars.V);
 420    public static RomanSymbol X => new(RomanChars.X);
 221    public static RomanSymbol L => new(RomanChars.L);
 422    public static RomanSymbol C => new(RomanChars.C);
 223    public static RomanSymbol D => new(RomanChars.D);
 224    public static RomanSymbol M => new(RomanChars.M);
 25
 26    public override string ToString()
 027    {
 028        return Char.ToString();
 029    }
 30
 31    public override bool Equals(object? @object)
 032    {
 033        if (@object is RomanSymbol romanSymbol)
 034        {
 035            return Equals(romanSymbol);
 36        }
 37
 038        return Equals(this, @object);
 039    }
 40
 41    protected bool Equals(RomanSymbol romanSymbol)
 042    {
 043        return Char == romanSymbol.Char;
 044    }
 45
 46    public override int GetHashCode()
 047    {
 048        return Char.GetHashCode();
 049    }
 50}