< Summary

Information
Class: Gateway.Versioning
Assembly: Gateway
File(s): /home/runner/work/dotnet-microservice/dotnet-microservice/Gateway/GlobalConfigurations/Versioning.cs
Tag: 34_11887803474
Line coverage
0%
Covered lines: 0
Uncovered lines: 19
Coverable lines: 19
Total lines: 30
Line coverage: 0%
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

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
AddVersioning(...)100%210%

File(s)

/home/runner/work/dotnet-microservice/dotnet-microservice/Gateway/GlobalConfigurations/Versioning.cs

#LineLine coverage
 1using Asp.Versioning;
 2
 3namespace Gateway;
 4
 5public static class Versioning
 6{
 7    public static WebApplicationBuilder AddVersioning(this WebApplicationBuilder builder)
 8    {
 09        builder
 010            .Services.AddApiVersioning(options =>
 011            {
 012                options.ApiVersionReader = new UrlSegmentApiVersionReader();
 013                options.ReportApiVersions = true;
 014                options
 015                    .Policies.Sunset(1.0)
 016                    .Effective(DateTimeOffset.Now.AddDays(60))
 017                    .Link("https://github.com/bchir")
 018                    .Title("Versioning Policy")
 019                    .Type("text/html");
 020            })
 021            .AddApiExplorer(options =>
 022            {
 023                options.GroupNameFormat = "'v'VVV";
 024                options.SubstituteApiVersionInUrl = true;
 025            })
 026            .EnableApiVersionBinding();
 27
 028        return builder;
 29    }
 30}