< 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@5f1d2b981c9d7292c11fd448428c6ab6c811c5de
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 11/19/2025 - 17:40:50 Line coverage: 75% (3/4) Branch coverage: 75% (3/4) Total lines: 27 Tag: Kestrun/Kestrun@fcf33342333cef0516fe0d0912a86709874fd026 11/19/2025 - 17:40:50 Line coverage: 75% (3/4) Branch coverage: 75% (3/4) Total lines: 27 Tag: Kestrun/Kestrun@fcf33342333cef0516fe0d0912a86709874fd026

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    {
 3318        if (builder is null)
 19        {
 020            throw new ArgumentNullException(nameof(builder));
 21        }
 22
 23        // IEndpointConventionBuilder exposes Add(Action<EndpointBuilder>)
 5324        builder.Add(ep => ep.Metadata.Add(new ScriptLanguageAttribute(language)));
 3325        return builder;   // keep fluent chaining
 26    }
 27}