< Summary

Information
Class: Elsa.Resilience.Endpoints.ResilienceStrategies.List.Endpoint
Assembly: Elsa.Resilience
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Resilience/Endpoints/ResilienceStrategies/List/Endpoint.cs
Line coverage
50%
Covered lines: 4
Uncovered lines: 4
Coverable lines: 8
Total lines: 23
Line coverage: 50%
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%11100%
Configure()100%11100%
HandleAsync()100%210%

File(s)

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

#LineLine coverage
 1using Elsa.Abstractions;
 2using Elsa.Models;
 3using Elsa.Resilience.Serialization;
 4using Microsoft.AspNetCore.Http;
 5
 6namespace Elsa.Resilience.Endpoints.ResilienceStrategies.List;
 7
 18public class Endpoint(IResilienceStrategyCatalog catalog, ResilienceStrategySerializer serializer) : ElsaEndpointWithout
 9{
 10    public override void Configure()
 11    {
 112        Get("/resilience/strategies");
 113        ConfigurePermissions("read:*", "read:resilience", "read:resilience:strategies");
 114    }
 15
 16    public override async Task HandleAsync(CancellationToken ct)
 17    {
 018        var strategies = (await catalog.ListAsync(ct)).ToList();
 019        var response = new ListResponse<IResilienceStrategy>(strategies);
 20
 021        await HttpContext.Response.WriteAsJsonAsync(response, serializer.SerializerOptions, ct);
 022    }
 23}