Skip to content

Commit

Permalink
wip: fix gpolocalgroup processor tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rvazarkar committed Jul 9, 2024
1 parent 2b84698 commit bc79072
Show file tree
Hide file tree
Showing 2 changed files with 358 additions and 335 deletions.
22 changes: 22 additions & 0 deletions src/CommonLib/Processors/GPOLocalGroupProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,28 @@ public TypedPrincipal ToTypedPrincipal() {
};
}

protected bool Equals(GroupAction other) {
return Action == other.Action && Target == other.Target && TargetSid == other.TargetSid && TargetType == other.TargetType && TargetRid == other.TargetRid;
}

public override bool Equals(object obj) {
if (ReferenceEquals(null, obj)) return false;
if (ReferenceEquals(this, obj)) return true;
if (obj.GetType() != this.GetType()) return false;
return Equals((GroupAction)obj);
}

public override int GetHashCode() {
unchecked {
var hashCode = (int)Action;
hashCode = (hashCode * 397) ^ (int)Target;
hashCode = (hashCode * 397) ^ (TargetSid != null ? TargetSid.GetHashCode() : 0);
hashCode = (hashCode * 397) ^ (int)TargetType;
hashCode = (hashCode * 397) ^ (int)TargetRid;
return hashCode;
}
}

public override string ToString() {
return
$"{nameof(Action)}: {Action}, {nameof(Target)}: {Target}, {nameof(TargetSid)}: {TargetSid}, {nameof(TargetType)}: {TargetType}, {nameof(TargetRid)}: {TargetRid}";
Expand Down
Loading

0 comments on commit bc79072

Please sign in to comment.