< Summary

Information
Class: ContextProviders.Kicktipp.Csv.MatchResultCsvMap
Assembly: ContextProviders.Kicktipp
File(s): /home/runner/work/KicktippAi/KicktippAi/src/ContextProviders.Kicktipp/Csv/MatchResultCsvMap.cs
Line coverage
100%
Covered lines: 11
Uncovered lines: 0
Coverable lines: 11
Total lines: 24
Line coverage: 100%
Branch coverage
100%
Covered branches: 10
Total branches: 10
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor()100%44100%

File(s)

/home/runner/work/KicktippAi/KicktippAi/src/ContextProviders.Kicktipp/Csv/MatchResultCsvMap.cs

#LineLine coverage
 1using CsvHelper.Configuration;
 2using EHonda.KicktippAi.Core;
 3
 4namespace ContextProviders.Kicktipp.Csv;
 5
 6/// <summary>
 7/// CsvHelper ClassMap for <see cref="MatchResult"/> defining the CSV schema for match history.
 8/// Uses empty string for score when goals are not available (pending matches).
 9/// </summary>
 10public sealed class MatchResultCsvMap : ClassMap<MatchResult>
 11{
 112    public MatchResultCsvMap()
 13    {
 114        Map(m => m.Competition).Index(0).Name("Competition");
 115        Map(m => m.HomeTeam).Index(1).Name("Home_Team");
 116        Map(m => m.AwayTeam).Index(2).Name("Away_Team");
 117        Map(m => m.HomeGoals).Index(3).Name("Score")
 118            .Convert(args => args.Value.HomeGoals.HasValue && args.Value.AwayGoals.HasValue
 119                ? $"{args.Value.HomeGoals}:{args.Value.AwayGoals}"
 120                : "");
 121        Map(m => m.Annotation).Index(4).Name("Annotation")
 122            .Convert(args => args.Value.Annotation ?? "");
 123    }
 24}

Methods/Properties

.ctor()