• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Sholtee / injector / 2251

27 Dec 2023 10:00AM UTC coverage: 90.723% (-2.0%) from 92.704%
2251

push

appveyor

Sholtee
Merge branch 'drop_opencover'

2171 of 2393 relevant lines covered (90.72%)

0.91 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

62.5
/SRC/Injector/Private/DotGraph/DotGraphElement.cs
1
/********************************************************************************
2
* DotGraphElement.cs                                                            *
3
*                                                                               *
4
* Author: Denes Solti                                                           *
5
********************************************************************************/
6
using System.Collections.Generic;
7
using System.Diagnostics.CodeAnalysis;
8
using System.Linq;
9

10
namespace Solti.Utils.DI.Internals
11
{
12
    /// <summary>
13
    /// Describes an abstract <a href="https://graphviz.org/">DOT graph</a> element
14
    /// </summary>
15
    internal abstract class DotGraphElement
16
    {
17
        protected DotGraphElement(string id) => Id = id;
1✔
18

19
        /// <summary>
20
        /// Attributes related to this element. Principal attributes can be found <a href="https://graphviz.org/documentation/">here</a>.
21
        /// </summary>
22
        public IDictionary<string, string> Attributes { get; } = new Dictionary<string, string>();
1✔
23

24
        public string Id { get; }
1✔
25

26
        public override string ToString() => Attributes.Count > 0
×
27
            ? $"{Id} [{string.Join(",", Attributes.Select(static attr => $"{attr.Key}={attr.Value}"))}];"
1✔
28
            : $"{Id};";
×
29

30
        [SuppressMessage("Globalization", "CA1307:Specify StringComparison for clarity")]
31
        public override int GetHashCode() => Id.GetHashCode();
1✔
32

33
        public override bool Equals(object obj) => obj is DotGraphElement other && other.Id == Id;
×
34
    }
35
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc