< 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_18869653307
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)
 13110        {
 13111            RouteGroupBuilder historyRepositoriesApi = app.MapGroup("/history-repositories");
 13112            historyRepositoriesApi.MapGet("/{projectId}",
 13113                (IHistoryRepositoryService historyRepositoryService,
 13114                [Description("ID of project")] string projectId)
 215                    => GetHistoryRepositories.Handle(historyRepositoryService, projectId))
 13116                .WithName("GetHistoryRepositories")
 13117                .WithDisplayName("GetHistoryRepositories")
 13118                .WithSummary("Gets the list of available history respoitories in project")
 13119                .WithDescription("Gets the list of available history respoitories in project")
 13120                .Produces<List<HistoryRepositoryModel>>(StatusCodes.Status200OK)
 13121                .Produces<string>(StatusCodes.Status404NotFound)
 13122                .Produces<string>(StatusCodes.Status400BadRequest);
 23
 13124            historyRepositoriesApi.MapGet("/{projectId}/{historyRepositoryName}",
 13125                (IHistoryRepositoryService historyRepositoryService,
 13126                [Description("ID of project")] string projectId,
 13127                [Description("Name of history repository")] string historyRepositoryName)
 228                    => GetHistoryRepository.Handle(historyRepositoryService, projectId, historyRepositoryName))
 13129                .WithName("GetHistoryRepository")
 13130                .WithDisplayName("GetHistoryRepository")
 13131                .WithSummary("Gets a project's history repository by its name")
 13132                .WithDescription("Gets a project's history repository by its name")
 13133                .Produces<HistoryRepositoryModel>(StatusCodes.Status200OK)
 13134                .Produces<string>(StatusCodes.Status404NotFound)
 13135                .Produces<string>(StatusCodes.Status400BadRequest);
 36
 13137            historyRepositoriesApi.MapPost("/{wipProjectId}",
 13138                (IHistoryRepositoryService historyRepositoryService,
 13139                [Description("ID of WIP project")] string wipProjectId,
 13140                [Description("History repository create request")] HistoryRepositoryModel historyRepositoryCreateRequest
 441                    => CreateHistoryRepository.Handle(historyRepositoryService, wipProjectId, historyRepositoryCreateReq
 13142                .WithName("CreateHistoryRepository")
 13143                .WithDisplayName("CreateHistoryRepository")
 13144                .WithSummary("Creates a history repository in a WIP project")
 13145                .WithDescription("Creates a history repository in a WIP project")
 13146                .Produces<HistoryRepositoryModel>(StatusCodes.Status201Created)
 13147                .Produces<string>(StatusCodes.Status404NotFound)
 13148                .Produces<string>(StatusCodes.Status400BadRequest);
 49
 13150            historyRepositoriesApi.MapPut("/{wipProjectId}/{historyRepositoryName}",
 13151                (IHistoryRepositoryService historyRepositoryService,
 13152                [Description("ID of WIP project")] string wipProjectId,
 13153                [Description("Name of history repository")] string historyRepositoryName,
 13154                [Description("History repository update request")] HistoryRepositoryModel historyRepositoryUpdateRequest
 355                    => UpdateHistoryRepository.Handle(historyRepositoryService, wipProjectId, historyRepositoryName, his
 13156                .WithName("UpdateHistoryRepository")
 13157                .WithDisplayName("UpdateHistoryRepository")
 13158                .WithSummary("Updates a history repository in a WIP project")
 13159                .WithDescription("Updates a history repository in a WIP project")
 13160                .Produces<HistoryRepositoryModel>(StatusCodes.Status200OK)
 13161                .Produces<string>(StatusCodes.Status404NotFound)
 13162                .Produces<string>(StatusCodes.Status400BadRequest);
 63
 13164            historyRepositoriesApi.MapDelete("/{wipProjectId}/{historyRepositoryName}",
 13165                (IHistoryRepositoryService historyRepositoryService,
 13166                [Description("ID of WIP project")] string wipProjectId,
 13167                [Description("Name of history repository")] string historyRepositoryName)
 368                    => DeleteHistoryRepository.Handle(historyRepositoryService, wipProjectId, historyRepositoryName))
 13169                .WithName("DeleteHistoryRepository")
 13170                .WithDisplayName("DeleteHistoryRepository")
 13171                .WithSummary("Deletes a history repository from a WIP project by its name")
 13172                .WithDescription("Deletes a history repository from a WIP project by its name")
 13173                .Produces(StatusCodes.Status204NoContent)
 13174                .Produces<string>(StatusCodes.Status404NotFound)
 13175                .Produces<string>(StatusCodes.Status400BadRequest);
 76
 13177            return app;
 13178        }
 79    }
 80}