< Summary - pva.SuperV

Information
Class: pva.SuperV.Api.Routes.HistoryRepositories.HistoryRepositoryEndpoints
Assembly: pva.SuperV.Api
File(s): /home/runner/work/pva.SuperV/pva.SuperV/pva.SuperV.Api/Routes/HistoryRepositories/HistoryRepositoryEndpoints.cs
Tag: dotnet-ubuntu_22190969454
Line coverage
100%
Covered lines: 64
Uncovered lines: 0
Coverable lines: 64
Total lines: 80
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
MapHistoryRepositoryEndpoints(...)100%11100%

File(s)

/home/runner/work/pva.SuperV/pva.SuperV/pva.SuperV.Api/Routes/HistoryRepositories/HistoryRepositoryEndpoints.cs

#LineLine coverage
 1using pva.SuperV.Model.HistoryRepositories;
 2using pva.SuperV.Model.Services;
 3using System.ComponentModel;
 4
 5namespace pva.SuperV.Api.Routes.HistoryRepositories
 6{
 7    public static class HistoryRepositoryEndpoints
 8    {
 9        public static WebApplication MapHistoryRepositoryEndpoints(this WebApplication app)
 14510        {
 14511            RouteGroupBuilder historyRepositoriesApi = app.MapGroup("/history-repositories");
 14512            historyRepositoriesApi.MapGet("/{projectId}",
 14513                (IHistoryRepositoryService historyRepositoryService,
 14514                [Description("ID of project")] string projectId)
 215                    => GetHistoryRepositories.Handle(historyRepositoryService, projectId))
 14516                .WithName("GetHistoryRepositories")
 14517                .WithDisplayName("GetHistoryRepositories")
 14518                .WithSummary("Gets the list of available history respoitories in project")
 14519                .WithDescription("Gets the list of available history respoitories in project")
 14520                .Produces<List<HistoryRepositoryModel>>(StatusCodes.Status200OK)
 14521                .Produces<string>(StatusCodes.Status404NotFound)
 14522                .Produces<string>(StatusCodes.Status400BadRequest);
 23
 14524            historyRepositoriesApi.MapGet("/{projectId}/{historyRepositoryName}",
 14525                (IHistoryRepositoryService historyRepositoryService,
 14526                [Description("ID of project")] string projectId,
 14527                [Description("Name of history repository")] string historyRepositoryName)
 228                    => GetHistoryRepository.Handle(historyRepositoryService, projectId, historyRepositoryName))
 14529                .WithName("GetHistoryRepository")
 14530                .WithDisplayName("GetHistoryRepository")
 14531                .WithSummary("Gets a project's history repository by its name")
 14532                .WithDescription("Gets a project's history repository by its name")
 14533                .Produces<HistoryRepositoryModel>(StatusCodes.Status200OK)
 14534                .Produces<string>(StatusCodes.Status404NotFound)
 14535                .Produces<string>(StatusCodes.Status400BadRequest);
 36
 14537            historyRepositoriesApi.MapPost("/{wipProjectId}",
 14538                (IHistoryRepositoryService historyRepositoryService,
 14539                [Description("ID of WIP project")] string wipProjectId,
 14540                [Description("History repository create request")] HistoryRepositoryModel historyRepositoryCreateRequest
 441                    => CreateHistoryRepository.Handle(historyRepositoryService, wipProjectId, historyRepositoryCreateReq
 14542                .WithName("CreateHistoryRepository")
 14543                .WithDisplayName("CreateHistoryRepository")
 14544                .WithSummary("Creates a history repository in a WIP project")
 14545                .WithDescription("Creates a history repository in a WIP project")
 14546                .Produces<HistoryRepositoryModel>(StatusCodes.Status201Created)
 14547                .Produces<string>(StatusCodes.Status404NotFound)
 14548                .Produces<string>(StatusCodes.Status400BadRequest);
 49
 14550            historyRepositoriesApi.MapPut("/{wipProjectId}/{historyRepositoryName}",
 14551                (IHistoryRepositoryService historyRepositoryService,
 14552                [Description("ID of WIP project")] string wipProjectId,
 14553                [Description("Name of history repository")] string historyRepositoryName,
 14554                [Description("History repository update request")] HistoryRepositoryModel historyRepositoryUpdateRequest
 355                    => UpdateHistoryRepository.Handle(historyRepositoryService, wipProjectId, historyRepositoryName, his
 14556                .WithName("UpdateHistoryRepository")
 14557                .WithDisplayName("UpdateHistoryRepository")
 14558                .WithSummary("Updates a history repository in a WIP project")
 14559                .WithDescription("Updates a history repository in a WIP project")
 14560                .Produces<HistoryRepositoryModel>(StatusCodes.Status200OK)
 14561                .Produces<string>(StatusCodes.Status404NotFound)
 14562                .Produces<string>(StatusCodes.Status400BadRequest);
 63
 14564            historyRepositoriesApi.MapDelete("/{wipProjectId}/{historyRepositoryName}",
 14565                (IHistoryRepositoryService historyRepositoryService,
 14566                [Description("ID of WIP project")] string wipProjectId,
 14567                [Description("Name of history repository")] string historyRepositoryName)
 368                    => DeleteHistoryRepository.Handle(historyRepositoryService, wipProjectId, historyRepositoryName))
 14569                .WithName("DeleteHistoryRepository")
 14570                .WithDisplayName("DeleteHistoryRepository")
 14571                .WithSummary("Deletes a history repository from a WIP project by its name")
 14572                .WithDescription("Deletes a history repository from a WIP project by its name")
 14573                .Produces(StatusCodes.Status204NoContent)
 14574                .Produces<string>(StatusCodes.Status404NotFound)
 14575                .Produces<string>(StatusCodes.Status400BadRequest);
 76
 14577            return app;
 14578        }
 79    }
 80}