< Summary - Kestrun — Combined Coverage

Information
Class: Kestrun.Hosting.Compression.KestrunCompressionServiceCollectionExtensions
Assembly: Kestrun
File(s): /home/runner/work/Kestrun/Kestrun/src/CSharp/Kestrun/Hosting/Compression/KestrunCompressionServiceCollectionExtensions.cs
Tag: Kestrun/Kestrun@2d87023b37eb91155071c91dd3d6a2eeb3004705
Line coverage
100%
Covered lines: 1
Uncovered lines: 0
Coverable lines: 1
Total lines: 21
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

Coverage history

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

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
AddKestrunCompressionOptOut(...)100%11100%

File(s)

/home/runner/work/Kestrun/Kestrun/src/CSharp/Kestrun/Hosting/Compression/KestrunCompressionServiceCollectionExtensions.cs

#LineLine coverage
 1using Microsoft.AspNetCore.ResponseCompression;
 2
 3namespace Kestrun.Hosting.Compression;
 4
 5/// <summary>
 6/// Extension methods to add Kestrun compression services.
 7/// </summary>
 8public static class KestrunCompressionServiceCollectionExtensions
 9{
 10    /// <summary>
 11    /// Adds Kestrun compression services to the service collection.
 12    /// This replaces the default <see cref="IResponseCompressionProvider"/> with
 13    /// <see cref="KestrunResponseCompressionProvider"/>, which respects endpoint metadata to
 14    /// disable compression.
 15    /// </summary>
 16    /// <param name="services">The service collection.</param>
 17    /// <returns>The service collection.</returns>
 18    public static IServiceCollection AddKestrunCompressionOptOut(this IServiceCollection services) =>
 19        // Replace the default provider with our decorator
 120        services.AddSingleton<IResponseCompressionProvider, KestrunResponseCompressionProvider>();
 21}