< Summary - Estud

Information
Class: Estud.Mocks.Configs.HttpConfigs
Assembly: Mocks
File(s): /home/runner/work/syki/syki/Mocks/Configs/HttpConfigs.cs
Tag: 114_29044117136
Line coverage
100%
Covered lines: 17
Uncovered lines: 0
Coverable lines: 17
Total lines: 33
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
AddHttpConfigs(...)100%11100%
UseControllers(...)100%11100%

File(s)

/home/runner/work/syki/syki/Mocks/Configs/HttpConfigs.cs

#LineLine coverage
 1using System.Text.Json;
 2using Estud.Mocks.Providers;
 3using System.Text.Json.Serialization;
 4
 5namespace Estud.Mocks.Configs;
 6
 7public static class HttpConfigs
 8{
 9    public static void AddHttpConfigs(this WebApplicationBuilder builder)
 10    {
 211        builder.Services.AddControllers()
 212            .ConfigureApplicationPartManager(apm =>
 413                apm.FeatureProviders.Add(
 414                    new RegisterOnlyMocksControllersFeatureProvider()));
 15
 216        builder.Services.AddControllers()
 217            .AddJsonOptions(options =>
 218            {
 219                options.JsonSerializerOptions.Converters.Add(new JsonStringEnumConverter());
 220                options.JsonSerializerOptions.PropertyNamingPolicy = JsonNamingPolicy.CamelCase;
 421            });
 22
 423        builder.Services.AddRouting(options => options.LowercaseUrls = true);
 224    }
 25
 26    public static void UseControllers(this IApplicationBuilder app)
 27    {
 228        app.UseEndpoints(options =>
 229        {
 230            options.MapControllers();
 431        });
 232    }
 33}