< Summary

Information
Class: MoreStructures.Graphs.DictionaryAdapterGraphDistances
Assembly: MoreStructures
File(s): /home/runner/work/MoreStructures/MoreStructures/MoreStructures/Graphs/DictionaryAdapterGraphDistances.cs
Line coverage
100%
Covered lines: 6
Uncovered lines: 0
Coverable lines: 6
Total lines: 26
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity Line coverage
get_Dictionary()100%1100%
get_Item(...)100%1100%
.ctor(...)100%1100%

File(s)

/home/runner/work/MoreStructures/MoreStructures/MoreStructures/Graphs/DictionaryAdapterGraphDistances.cs

#LineLine coverage
 1namespace MoreStructures.Graphs;
 2
 3/// <summary>
 4/// A <see cref="IGraphDistances"/> retrieving distances from a <see cref="IDictionary{TKey, TValue}"/>, mapping
 5/// couples of <see cref="int"/> values (ids of endpoints of each edge of the graph) to <see cref="int"/> values
 6/// (edge distances).
 7/// </summary>
 8public class DictionaryAdapterGraphDistances : IGraphDistances
 9{
 2125010    private IDictionary<(int, int), int> Dictionary { get; }
 11
 12    /// <inheritdoc path="//*[not(self::remarks)]"/>
 13    /// <remarks>
 14    /// Retrieves the value from the underlying dictionary.
 15    /// </remarks>
 2125016    public int this[(int edgeStart, int edgeEnd) edge] => Dictionary[edge];
 17
 18    /// <summary>
 19    ///     <inheritdoc cref="DictionaryAdapterGraphDistances"/>
 20    /// </summary>
 21    /// <param name="dictionary">The mapping between edges and distances.</param>
 33422    public DictionaryAdapterGraphDistances(IDictionary<(int, int), int> dictionary)
 33423    {
 33424        Dictionary = dictionary;
 33425    }
 26}