< Summary

Information
Class: NexusLabs.Needlr.AgentFramework.Generators.GraphEdgeEntry
Assembly: NexusLabs.Needlr.AgentFramework.Generators
File(s): /home/runner/work/needlr/needlr/src/NexusLabs.Needlr.AgentFramework.Generators/Models/GraphEdgeEntry.cs
Line coverage
100%
Covered lines: 34
Uncovered lines: 0
Coverable lines: 34
Total lines: 69
Line coverage: 100%
Branch coverage
83%
Covered branches: 20
Total branches: 24
Branch coverage: 83.3%
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_SourceAgentTypeName()100%11100%
get_SourceAgentClassName()100%11100%
get_GraphName()100%11100%
get_TargetAgentTypeName()100%11100%
get_Condition()100%11100%
get_IsRequired()100%11100%
get_NodeRoutingMode()100%11100%
Equals(...)100%1212100%
Equals(...)100%22100%
GetHashCode()60%1010100%
op_Equality(...)100%11100%
op_Inequality(...)100%11100%

File(s)

/home/runner/work/needlr/needlr/src/NexusLabs.Needlr.AgentFramework.Generators/Models/GraphEdgeEntry.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 GraphEdgeEntry : IEquatable<GraphEdgeEntry>
 9{
 10    public GraphEdgeEntry(
 11        string sourceAgentTypeName,
 12        string sourceAgentClassName,
 13        string graphName,
 14        string targetAgentTypeName,
 15        string? condition,
 16        bool isRequired,
 17        int? nodeRoutingMode)
 18    {
 3419        SourceAgentTypeName = sourceAgentTypeName;
 3420        SourceAgentClassName = sourceAgentClassName;
 3421        GraphName = graphName;
 3422        TargetAgentTypeName = targetAgentTypeName;
 3423        Condition = condition;
 3424        IsRequired = isRequired;
 3425        NodeRoutingMode = nodeRoutingMode;
 3426    }
 27
 6828    public string SourceAgentTypeName { get; }
 2929    public string SourceAgentClassName { get; }
 7030    public string GraphName { get; }
 7531    public string TargetAgentTypeName { get; }
 8932    public string? Condition { get; }
 4633    public bool IsRequired { get; }
 3834    public int? NodeRoutingMode { get; }
 35
 36    public bool Equals(GraphEdgeEntry other) =>
 937        string.Equals(SourceAgentTypeName, other.SourceAgentTypeName, StringComparison.Ordinal) &&
 938        string.Equals(SourceAgentClassName, other.SourceAgentClassName, StringComparison.Ordinal) &&
 939        string.Equals(GraphName, other.GraphName, StringComparison.Ordinal) &&
 940        string.Equals(TargetAgentTypeName, other.TargetAgentTypeName, StringComparison.Ordinal) &&
 941        string.Equals(Condition, other.Condition, StringComparison.Ordinal) &&
 942        IsRequired == other.IsRequired &&
 943        NodeRoutingMode == other.NodeRoutingMode;
 44
 45    public override bool Equals(object? obj) =>
 246        obj is GraphEdgeEntry other && Equals(other);
 47
 48    public override int GetHashCode()
 49    {
 50        unchecked
 51        {
 452            var hash = 17;
 453            hash = hash * 31 + (SourceAgentTypeName?.GetHashCode() ?? 0);
 454            hash = hash * 31 + (SourceAgentClassName?.GetHashCode() ?? 0);
 455            hash = hash * 31 + (GraphName?.GetHashCode() ?? 0);
 456            hash = hash * 31 + (TargetAgentTypeName?.GetHashCode() ?? 0);
 457            hash = hash * 31 + (Condition?.GetHashCode() ?? 0);
 458            hash = hash * 31 + IsRequired.GetHashCode();
 459            hash = hash * 31 + NodeRoutingMode.GetHashCode();
 460            return hash;
 61        }
 62    }
 63
 64    public static bool operator ==(GraphEdgeEntry left, GraphEdgeEntry right) =>
 265        left.Equals(right);
 66
 67    public static bool operator !=(GraphEdgeEntry left, GraphEdgeEntry right) =>
 268        !left.Equals(right);
 69}