< Summary

Information
Class: Amusoft.DotnetNew.Tests.Templating.TemplatingSettings
Assembly: Amusoft.DotnetNew.Tests
File(s): /home/runner/work/Amusoft.DotnetNew.Tests/Amusoft.DotnetNew.Tests/src/Amusoft.DotnetNew.Tests/Templating/TemplatingSettings.cs
Tag: 127_14865883074
Line coverage
100%
Covered lines: 5
Uncovered lines: 0
Coverable lines: 5
Total lines: 31
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_PrintPattern()100%11100%
.ctor()100%11100%
get_GetAllFileContentsFilter()100%11100%
.cctor()100%11100%
GetAllFileContentsFilterImpl(...)100%11100%

File(s)

/home/runner/work/Amusoft.DotnetNew.Tests/Amusoft.DotnetNew.Tests/src/Amusoft.DotnetNew.Tests/Templating/TemplatingSettings.cs

#LineLine coverage
 1using System;
 2using System.Collections.Generic;
 3using System.Linq;
 4using Amusoft.DotnetNew.Tests.Diagnostics;
 5using Amusoft.DotnetNew.Tests.Scaffolding;
 6
 7namespace Amusoft.DotnetNew.Tests.Templating;
 8
 9/// <summary>
 10/// Core API for customization
 11/// </summary>
 12public record class TemplatingSettings
 13{
 14  /// <summary>
 15  /// Pattern used for printing data
 16  /// </summary>
 3517  public PrintDelegate PrintPattern { get; init; } = (token, content)
 3418    => $"---{token}---" + Environment.NewLine + Environment.NewLine + content + Environment.NewLine + Environment.NewLin
 19
 20  /// <summary>
 21  /// Default filter applied for <see cref="Scaffold.GetAllFileContentsAsync"/>
 22  /// </summary>
 1823  public RelativeFileFilter GetAllFileContentsFilter { get; init; } = GetAllFileContentsFilterImpl;
 24
 125  private static readonly HashSet<string> FilteredExtensions = new([".jpg", ".png", ".gif"]);
 26
 27  private static bool GetAllFileContentsFilterImpl(string relativepath)
 28  {
 1029    return FilteredExtensions.Any(end => relativepath.EndsWith(end));
 30  }
 31}