< Summary

Information
Class: Gateway.Program
Assembly: Gateway
File(s): /home/runner/work/dotnet-microservice/dotnet-microservice/Gateway/Program.cs
Tag: 34_11887803474
Line coverage
0%
Covered lines: 0
Uncovered lines: 27
Coverable lines: 27
Total lines: 48
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
Main()100%210%

File(s)

/home/runner/work/dotnet-microservice/dotnet-microservice/Gateway/Program.cs

#LineLine coverage
 1using Gateway.Apis;
 2using Gateway.Apis.Amqp.Orders;
 3using Gateway.Swagger;
 4using HealthChecks.ApplicationStatus.DependencyInjection;
 5using Microsoft.OpenApi.Models;
 6using Saunter;
 7using Swashbuckle.AspNetCore.SwaggerGen;
 8
 9namespace Gateway;
 10
 11public class Program
 12{
 13    private static async Task Main(string[] args)
 14    {
 015        var builder = WebApplication.CreateBuilder(args);
 016        builder.Configuration.AddEnvironmentVariables();
 17
 018        var serviceMetaData = builder.AddServiceMetadata();
 19
 020        builder.AddVersioning().AddSwagger().AddLogger();
 21        // security reasons
 022        builder.WebHost.ConfigureKestrel(options => options.AddServerHeader = false);
 023        builder.AddOpenTelemetryIntegration(serviceMetaData);
 024        builder.Services.AddEndpointsApiExplorer();
 025        builder
 026            .Services.AddHealthChecks()
 027            .AddDiskStorageHealthCheck(x => x.CheckAllDrives = true)
 028            .AddProcessAllocatedMemoryHealthCheck(500)
 029            .AddApplicationStatus()
 030            .AddSqlServer("MyDataBase");
 031        builder.Services.AddProblemDetails();
 032        builder.AddApis();
 33
 034        var app = builder.Build();
 35
 036        app.UseRequestLogging();
 037        app.UseStatusCodePages();
 038        app.UseExceptionHandler();
 039        app.UseHttpsRedirection();
 040        app.UseProbes();
 41
 042        app.UseApis();
 043        app.UseSwaggerDocumentation();
 044        app.MapAsyncApiDocuments();
 045        app.MapAsyncApiUi();
 046        await app.RunAsync();
 047    }
 48}

Methods/Properties

Main()