< Summary - Kestrun — Combined Coverage

Information
Class: Kestrun.TBuilder.EndpointConventionBuilderLanguageExtensions
Assembly: Kestrun
File(s): /home/runner/work/Kestrun/Kestrun/src/CSharp/Kestrun/TBuilder/EndpointConventionBuilderLanguageExtensions.cs
Tag: Kestrun/Kestrun@2d87023b37eb91155071c91dd3d6a2eeb3004705
Line coverage
75%
Covered lines: 3
Uncovered lines: 1
Coverable lines: 4
Total lines: 27
Line coverage: 75%
Branch coverage
75%
Covered branches: 3
Total branches: 4
Branch coverage: 75%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Coverage history

Coverage history 0 25 50 75 100 10/13/2025 - 16:52:37 Line coverage: 75% (3/4) Branch coverage: 75% (3/4) Total lines: 27 Tag: Kestrun/Kestrun@10d476bee71c71ad215bb8ab59f219887b5b4a5e 10/13/2025 - 16:52:37 Line coverage: 75% (3/4) Branch coverage: 75% (3/4) Total lines: 27 Tag: Kestrun/Kestrun@10d476bee71c71ad215bb8ab59f219887b5b4a5e

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
WithLanguage(...)75%4475%

File(s)

/home/runner/work/Kestrun/Kestrun/src/CSharp/Kestrun/TBuilder/EndpointConventionBuilderLanguageExtensions.cs

#LineLine coverage
 1using Kestrun.Scripting;
 2
 3namespace Kestrun.TBuilder;
 4
 5/// <summary>
 6/// Extension methods for <see cref="IEndpointConventionBuilder"/> to support script language metadata.
 7/// </summary>
 8public static class EndpointConventionBuilderLanguageExtensions
 9{
 10    /// <summary>
 11    /// Tags any endpoint builder with <see cref="ScriptLanguageAttribute"/>.
 12    /// Works for RouteHandlerBuilder, RouteGroupBuilder, etc.
 13    /// </summary>
 14    public static TBuilder WithLanguage<TBuilder>(
 15        this TBuilder builder, ScriptLanguage language)
 16        where TBuilder : IEndpointConventionBuilder
 17    {
 3218        if (builder is null)
 19        {
 020            throw new ArgumentNullException(nameof(builder));
 21        }
 22
 23        // IEndpointConventionBuilder exposes Add(Action<EndpointBuilder>)
 5224        builder.Add(ep => ep.Metadata.Add(new ScriptLanguageAttribute(language)));
 3225        return builder;   // keep fluent chaining
 26    }
 27}