< Summary

Class:SharpHoundCommonLib.OutputTypes.Session
Assembly:SharpHoundCommonLib
File(s):D:\a\SharpHoundCommon\SharpHoundCommon\src\CommonLib\OutputTypes\Session.cs
Covered lines:13
Uncovered lines:5
Coverable lines:18
Total lines:42
Line coverage:72.2% (13 of 18)
Covered branches:6
Total branches:16
Branch coverage:37.5% (6 of 16)

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
Equals(...)50%20100%
Equals(...)50%60100%
GetHashCode()0%400%

File(s)

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

#LineLine coverage
 1namespace SharpHoundCommonLib.OutputTypes
 2{
 3    public class Session
 4    {
 5        private string _computerSID;
 6        private string _userSID;
 7
 8        public string UserSID
 9        {
 210            get => _userSID;
 1411            set => _userSID = value?.ToUpper();
 12        }
 13
 14        public string ComputerSID
 15        {
 216            get => _computerSID;
 1417            set => _computerSID = value?.ToUpper();
 18        }
 19
 20        protected bool Equals(Session other)
 721        {
 722            return _computerSID == other._computerSID && _userSID == other._userSID;
 723        }
 24
 25        public override bool Equals(object obj)
 726        {
 727            if (ReferenceEquals(null, obj)) return false;
 728            if (ReferenceEquals(this, obj)) return true;
 729            if (obj.GetType() != GetType()) return false;
 730            return Equals((Session) obj);
 731        }
 32
 33        public override int GetHashCode()
 034        {
 35            unchecked
 036            {
 037                return ((_computerSID != null ? _computerSID.GetHashCode() : 0) * 397) ^
 038                       (_userSID != null ? _userSID.GetHashCode() : 0);
 39            }
 040        }
 41    }
 42}