< Summary

Class:Itinero.Instructions.Types.IntersectionInstruction
Assembly:Itinero.Instructions
File(s):/home/runner/work/routing2/routing2/src/Itinero.Instructions/Types/IntersectionInstruction.cs
Covered lines:6
Uncovered lines:4
Coverable lines:10
Total lines:37
Line coverage:60% (6 of 10)
Covered branches:0
Total branches:0
Tag:224_14471318300

Metrics

MethodBranch coverage Cyclomatic complexity Line coverage
.ctor(...)100%1100%
ToString()100%10%

File(s)

/home/runner/work/routing2/routing2/src/Itinero.Instructions/Types/IntersectionInstruction.cs

#LineLine coverage
 1using System.Collections.Generic;
 2
 3namespace Itinero.Instructions.Types;
 4
 5/// <summary>
 6///     The crossroad-instructions is an instruction that helps travellers cross intersections.
 7///     When multiple streets are coming together on nearly the same point (e.g. only a few meters apart), then the
 8///     traveller can get confused.
 9///     And lets be honest, 'turn right' isn't all that clear when there is a road slightly right, right and sharp right
 10/// </summary>
 11public class IntersectionInstruction : BaseInstruction
 12{
 13    public readonly uint ActualIndex;
 14
 15    /// <summary>
 16    ///     The list with all the branches and properties of all the roads at this crossroads, *except* the one we just 
 17    ///     from.
 18    ///     They are sorted by their relativeDegrees (where 0° is straight on the direction we came from)
 19    /// </summary>
 20    public readonly List<(int relativeDegrees, IEnumerable<(string, string)> tags)> AllRoads;
 21
 22
 23    public IntersectionInstruction(IndexedRoute route, int shapeIndex, int shapeIndexEnd, int turnDegrees,
 424        List<(int relativeDegrees, IEnumerable<(string, string)> tags)> allRoads, uint actualIndex) : base(
 425        route, shapeIndex, shapeIndexEnd, turnDegrees)
 426    {
 427        AllRoads = allRoads;
 428        ActualIndex = actualIndex;
 429    }
 30
 31
 32    public override string ToString()
 033    {
 034        return
 035            $"On the crossing: turn {this.TurnDegrees}° (road {ActualIndex + 1}/{AllRoads.Count} if left to right indexe
 036    }
 37}

Methods/Properties

.ctor(...)
ToString()