< Summary

Information
Class: Elsa.Labels.Endpoints.Labels.List.List
Assembly: Elsa.Labels
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Labels/Endpoints/Labels/List/Endpoint.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 9
Coverable lines: 9
Total lines: 26
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

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%210%
Configure()100%210%
ExecuteAsync()100%210%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Labels/Endpoints/Labels/List/Endpoint.cs

#LineLine coverage
 1using Elsa.Labels.Contracts;
 2using FastEndpoints;
 3
 4namespace Elsa.Labels.Endpoints.Labels.List;
 5
 6public class List : Endpoint<Request, Response, PageMapper>
 7{
 8    private readonly ILabelStore _store;
 9
 010    public List(ILabelStore store)
 11    {
 012        _store = store;
 013    }
 14
 15    public override void Configure()
 16    {
 017        Get("/labels");
 018        Policies(Constants.PolicyName);
 019    }
 20
 21    public override async Task<Response> ExecuteAsync(Request request, CancellationToken cancellationToken)
 22    {
 023        var pageOfLabels = await _store.ListAsync(request.ToPageArgs(), cancellationToken);
 024        return Map.FromEntity(pageOfLabels);
 025    }
 26}