< Summary

Class:Itinero.Instructions.Types.StartInstruction
Assembly:Itinero.Instructions
File(s):/home/runner/work/routing2/routing2/src/Itinero.Instructions/Types/StartInstruction.cs
Covered lines:14
Uncovered lines:4
Coverable lines:18
Total lines:53
Line coverage:77.7% (14 of 18)
Covered branches:1
Total branches:2
Branch coverage:50% (1 of 2)
Tag:224_14471318300

Metrics

MethodBranch coverage Cyclomatic complexity Line coverage
.ctor(...)50%2100%
.ctor(...)100%1100%
get_StartDegrees()100%1100%
get_ProjectionDistance()100%1100%
get_Then()100%1100%
ToString()100%10%

File(s)

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

#LineLine coverage
 1using System;
 2
 3namespace Itinero.Instructions.Types;
 4
 5/***
 6 * The 'startInstruction' represents the projection from the actual startpoint (e.g. an adress) to the snapped point on 
 7 * It doesn't really have an associated segment.
 8 */
 9public class StartInstruction : BaseInstruction
 10{
 11    public StartInstruction(IndexedRoute route, int turnDegrees, int absoluteStartingDegrees,
 12        uint projectionDistance, BaseInstruction? contained = null) :
 1913        base(route, 0, Math.Max(0, contained?.ShapeIndexEnd ?? 0), turnDegrees)
 1914    {
 1915        this.StartDegrees = absoluteStartingDegrees;
 1916        this.ProjectionDistance = projectionDistance;
 1917        this.Then = contained;
 1918    }
 19
 20
 421    public StartInstruction(IndexedRoute route, BaseInstruction? contained = null) : this(route,
 422        0,
 423        route.DepartingDirectionAt(0).NormalizeDegrees(),
 424        0, contained)
 825    { }
 26
 27    /// <summary>
 28    ///     The compass degrees to start the trip, with 0° being 'go to the north'
 29    /// </summary>
 30    /// <remarks>
 31    ///     The 'turnDegrees' is relative to the actual startpoint, thus if walking from the startpoint to the
 32    ///     snappedpoint, the amount of degrees to turn then
 33    /// </remarks>
 34
 10235    public int StartDegrees { get; }
 36
 37    /// <summary>
 38    ///     The distance between the actual start point and the snapped start point on the road
 39    /// </summary>
 10240    public uint ProjectionDistance { get; }
 41
 42    /// <summary>
 43    ///     The instruction following the start instruction
 44    /// </summary>
 45    // ReSharper disable once UnusedAutoPropertyAccessor.Global
 10246    public BaseInstruction Then { get; }
 47
 48    public override string ToString()
 049    {
 050        return
 051            $"Start by going {this.ProjectionDistance}m towards the road, then turn {this.TurnDegrees}° to start a {this
 052    }
 53}