< Summary

Information
Class: NexusLabs.Needlr.AgentFramework.Generators.GraphNodeEntry
Assembly: NexusLabs.Needlr.AgentFramework.Generators
File(s): /home/runner/work/needlr/needlr/src/NexusLabs.Needlr.AgentFramework.Generators/Models/GraphNodeEntry.cs
Line coverage
100%
Covered lines: 22
Uncovered lines: 0
Coverable lines: 22
Total lines: 54
Line coverage: 100%
Branch coverage
57%
Covered branches: 8
Total branches: 14
Branch coverage: 57.1%
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_AgentTypeName()100%11100%
get_AgentClassName()100%11100%
get_GraphName()100%11100%
get_JoinMode()100%11100%
Equals(...)50%66100%
Equals(...)100%22100%
GetHashCode()50%66100%
op_Equality(...)100%11100%
op_Inequality(...)100%11100%

File(s)

/home/runner/work/needlr/needlr/src/NexusLabs.Needlr.AgentFramework.Generators/Models/GraphNodeEntry.cs

#LineLine coverage
 1// Copyright (c) NexusLabs. All rights reserved.
 2// Licensed under the MIT License.
 3
 4using System;
 5
 6namespace NexusLabs.Needlr.AgentFramework.Generators;
 7
 8internal readonly struct GraphNodeEntry : IEquatable<GraphNodeEntry>
 9{
 10    public GraphNodeEntry(
 11        string agentTypeName,
 12        string agentClassName,
 13        string graphName,
 14        int joinMode)
 15    {
 916        AgentTypeName = agentTypeName;
 917        AgentClassName = agentClassName;
 918        GraphName = graphName;
 919        JoinMode = joinMode;
 920    }
 21
 1622    public string AgentTypeName { get; }
 1523    public string AgentClassName { get; }
 1824    public string GraphName { get; }
 1825    public int JoinMode { get; }
 26
 27    public bool Equals(GraphNodeEntry other) =>
 628        string.Equals(AgentTypeName, other.AgentTypeName, StringComparison.Ordinal) &&
 629        string.Equals(AgentClassName, other.AgentClassName, StringComparison.Ordinal) &&
 630        string.Equals(GraphName, other.GraphName, StringComparison.Ordinal) &&
 631        JoinMode == other.JoinMode;
 32
 33    public override bool Equals(object? obj) =>
 234        obj is GraphNodeEntry other && Equals(other);
 35
 36    public override int GetHashCode()
 37    {
 38        unchecked
 39        {
 240            var hash = 17;
 241            hash = hash * 31 + (AgentTypeName?.GetHashCode() ?? 0);
 242            hash = hash * 31 + (AgentClassName?.GetHashCode() ?? 0);
 243            hash = hash * 31 + (GraphName?.GetHashCode() ?? 0);
 244            hash = hash * 31 + JoinMode.GetHashCode();
 245            return hash;
 46        }
 47    }
 48
 49    public static bool operator ==(GraphNodeEntry left, GraphNodeEntry right) =>
 150        left.Equals(right);
 51
 52    public static bool operator !=(GraphNodeEntry left, GraphNodeEntry right) =>
 253        !left.Equals(right);
 54}