< Summary

Class:Itinero.Indexes.AttributeSetMap
Assembly:Itinero
File(s):/home/runner/work/routing2/routing2/src/Itinero/Indexes/AttributeSetMap.cs
Covered lines:11
Uncovered lines:0
Coverable lines:11
Total lines:43
Line coverage:100% (11 of 11)
Covered branches:2
Total branches:2
Branch coverage:100% (2 of 2)
Tag:224_14471318300

Metrics

MethodBranch coverage Cyclomatic complexity Line coverage
.ctor(...)100%2100%
get_Id()100%1100%
Map(...)100%1100%
Default()100%1100%

File(s)

/home/runner/work/routing2/routing2/src/Itinero/Indexes/AttributeSetMap.cs

#LineLine coverage
 1using System;
 2using System.Collections.Generic;
 3using System.Linq;
 4
 5namespace Itinero.Indexes;
 6
 7/// <summary>
 8/// Represents a mapping from attributes sets to sets that only keep useful attributes.
 9/// </summary>
 10public class AttributeSetMap
 11{
 12    /// <summary>
 13    /// Creates a new map.
 14    /// </summary>
 15    /// <param name="id">The id.</param>
 31016    protected AttributeSetMap(Guid? id = null)
 31017    {
 31018        this.Id = id ?? Guid.Empty;
 31019    }
 20
 21    /// <summary>
 22    /// Gets the id.
 23    /// </summary>
 145824    public Guid Id { get; protected set; }
 25
 26    /// <summary>
 27    /// Maps the attribute set to a subset of the attributes keeping only the useful attributes.
 28    /// </summary>
 29    /// <param name="attributes">The attributes.</param>
 30    /// <returns>A subset of attributes.</returns>
 31    public virtual IEnumerable<(string key, string value)> Map(IEnumerable<(string key, string value)> attributes)
 9732    {
 9733        return Enumerable.Empty<(string key, string value)>();
 9734    }
 35
 36    /// <summary>
 37    /// A default empty map.
 38    /// </summary>
 39    public static AttributeSetMap Default()
 30240    {
 30241        return new AttributeSetMap();
 30242    }
 43}

Methods/Properties

.ctor(...)
get_Id()
Map(...)
Default()