< Summary

Class:SharpHoundCommonLib.OutputTypes.TypedPrincipal
Assembly:SharpHoundCommonLib
File(s):D:\a\SharpHoundCommon\SharpHoundCommon\src\CommonLib\OutputTypes\TypedPrincipal.cs
Covered lines:26
Uncovered lines:0
Coverable lines:26
Total lines:46
Line coverage:100% (26 of 26)
Covered branches:5
Total branches:10
Branch coverage:50% (5 of 10)

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
.ctor()100%10100%
.ctor(...)100%10100%
ToString()100%10100%
Equals(...)50%20100%
Equals(...)50%60100%
GetHashCode()50%20100%

File(s)

D:\a\SharpHoundCommon\SharpHoundCommon\src\CommonLib\OutputTypes\TypedPrincipal.cs

#LineLine coverage
 1using SharpHoundCommonLib.Enums;
 2
 3namespace SharpHoundCommonLib.OutputTypes
 4{
 5    public class TypedPrincipal
 6    {
 357        public TypedPrincipal()
 358        {
 359        }
 10
 16411        public TypedPrincipal(string objectIdentifier, Label type)
 16412        {
 16413            ObjectIdentifier = objectIdentifier;
 16414            ObjectType = type;
 16415        }
 16
 37217        public string ObjectIdentifier { get; set; }
 37618        public Label ObjectType { get; set; }
 19
 20        public override string ToString()
 821        {
 822            return $"{ObjectIdentifier} - {ObjectType}";
 823        }
 24
 25        protected bool Equals(TypedPrincipal other)
 2126        {
 2127            return ObjectIdentifier == other.ObjectIdentifier && ObjectType == other.ObjectType;
 2128        }
 29
 30        public override bool Equals(object obj)
 2131        {
 2132            if (ReferenceEquals(null, obj)) return false;
 2133            if (ReferenceEquals(this, obj)) return true;
 2134            if (obj.GetType() != GetType()) return false;
 2135            return Equals((TypedPrincipal) obj);
 2136        }
 37
 38        public override int GetHashCode()
 1139        {
 40            unchecked
 1141            {
 1142                return ((ObjectIdentifier != null ? ObjectIdentifier.GetHashCode() : 0) * 397) ^ (int) ObjectType;
 43            }
 1144        }
 45    }
 46}