< Summary

Information
Class: Program
Assembly: TicTacToeApp.API
File(s): /home/runner/work/TicTacToe/TicTacToe/TicTacToeApp.API/Program.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 19
Coverable lines: 19
Total lines: 34
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 2
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
<Main>$(...)0%620%

File(s)

/home/runner/work/TicTacToe/TicTacToe/TicTacToeApp.API/Program.cs

#LineLine coverage
 1using Microsoft.EntityFrameworkCore;
 2using TicTacToeApp.API.Data;
 3using TicTacToeApp.API.Endpoints;
 4using TicTacToeApp.API.Extensions;
 5using TicTacToeApp.API.Interfaces;
 6using TicTacToeApp.API.Repositories;
 7using TicTacToeApp.API.Middleware;
 8
 09var builder = WebApplication.CreateBuilder(args);
 10
 011builder.Services
 012    .AddSerializeServices()
 013    .AddCors()
 014    .AddSwaggerServices()
 015    .AddScoped<IGameAsyncRepository, GameAsyncRepository>()
 016    .AddDbContext<TicTacToeContext>(o =>
 017        o.UseNpgsql(builder.Configuration.GetConnectionString("PostgreSQL")));
 18
 019var app = builder.Build();
 20
 021if (app.Environment.IsProduction())
 22{
 023    using var scope = app.Services.CreateScope();
 024    var dbContext = scope.ServiceProvider.GetRequiredService<TicTacToeContext>();
 025    dbContext.Database.EnsureDeleted();
 026    dbContext.Database.Migrate();
 27}
 28
 029app.UseMiddleware<ExceptionHandlerMiddleware>();
 030app.UseCors(o => o.AllowAnyHeader().AllowAnyMethod().AllowAnyOrigin());
 031app.UseSwaggerMiddleware();
 032app.UseGameEndpoints();
 33
 034app.Run();

Methods/Properties

<Main>$(System.String[])