< Summary - Syki

Information
Class: Syki.Front.Configs.HttpConfigs
Assembly: Front
File(s): /home/runner/work/syki/syki/Front/Configs/HttpConfigs.cs
Tag: 4_16869239191
Line coverage
35%
Covered lines: 5
Uncovered lines: 9
Coverable lines: 14
Total lines: 29
Line coverage: 35.7%
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%210%
.cctor()100%11100%

File(s)

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

#LineLine coverage
 1using System.Text.Json;
 2using System.Text.Json.Serialization;
 3
 4namespace Syki.Front.Configs;
 5
 6public static class HttpConfigs
 7{
 8    public static void AddHttpConfigs(this WebAssemblyHostBuilder builder)
 9    {
 010        builder.Services.AddScoped<SykiDelegatingHandler>();
 11
 012        var apiUrl = builder.Configuration.GetSection("ApiUrl").Value!;
 13
 014        builder.Services
 015            .AddHttpClient("HttpClient", x => x.BaseAddress = new Uri(apiUrl))
 016            .AddHttpMessageHandler<SykiDelegatingHandler>();
 17
 018        builder.Services.AddTransient(sp => sp.GetRequiredService<IHttpClientFactory>()
 019            .CreateClient("HttpClient"));
 20
 021        builder.Services.AddScoped<SignalRConnectionManager>();
 022    }
 23
 224    public static JsonSerializerOptions JsonOptions = new()
 225    {
 226        PropertyNameCaseInsensitive = true,
 227        Converters = { new JsonStringEnumConverter() }
 228    };
 29}