< Summary

Class:Itinero.Network.Mutation.RoutingNetworkMutatorExtensions
Assembly:Itinero
File(s):/home/runner/work/routing2/routing2/src/Itinero/Network/Mutation/RoutingNetworkMutatorExtensions.cs
Covered lines:3
Uncovered lines:6
Coverable lines:9
Total lines:37
Line coverage:33.3% (3 of 9)
Covered branches:0
Total branches:2
Branch coverage:0% (0 of 2)
Tag:224_14471318300

Metrics

MethodBranch coverage Cyclomatic complexity Line coverage
GetVertex(...)0%20%
AddVertex(...)100%1100%

File(s)

/home/runner/work/routing2/routing2/src/Itinero/Network/Mutation/RoutingNetworkMutatorExtensions.cs

#LineLine coverage
 1using System;
 2using Itinero.Profiles;
 3
 4namespace Itinero.Network.Mutation;
 5
 6public static class RoutingNetworkMutatorExtensions
 7{
 8    /// <summary>
 9    /// Gets the location of the given vertex.
 10    /// </summary>
 11    /// <param name="routingNetwork">The network</param>
 12    /// <param name="vertex">The vertex.</param>
 13    /// <returns>The location.</returns>
 14    /// <exception cref="ArgumentOutOfRangeException">When the vertex doesn't exist.</exception>
 15    public static (double longitude, double latitude, float? e) GetVertex(this RoutingNetworkMutator routingNetwork,
 16        VertexId vertex)
 017    {
 018        if (!routingNetwork.TryGetVertex(vertex, out var longitude, out var latitude, out var e))
 019        {
 020            throw new ArgumentOutOfRangeException(nameof(vertex));
 21        }
 22
 023        return (longitude, latitude, e);
 024    }
 25
 26    /// <summary>
 27    /// Adds a new vertex.
 28    /// </summary>
 29    /// <param name="routingNetwork">The mutable network.</param>
 30    /// <param name="location">The location.</param>
 31    /// <returns>The vertex id.</returns>
 32    public static VertexId AddVertex(this RoutingNetworkMutator routingNetwork,
 33        (double longitude, double latitude, float? e) location)
 634    {
 635        return routingNetwork.AddVertex(location.longitude, location.latitude, location.e);
 636    }
 37}

Methods/Properties

GetVertex(...)
AddVertex(...)