< 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    {
 397        public TypedPrincipal()
 398        {
 399        }
 10
 17611        public TypedPrincipal(string objectIdentifier, Label type)
 17612        {
 17613            ObjectIdentifier = objectIdentifier;
 17614            ObjectType = type;
 17615        }
 16
 41017        public string ObjectIdentifier { get; set; }
 39518        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}