< Summary

Information
Class: ClutterStock.Domain.Features.Locations.GetLocations.GetLocationsEndpoint
Assembly: Domain
File(s): /home/runner/work/ClutterStock/ClutterStock/backend/src/Domain/Features/Locations/GetLocations/GetLocationsEndpoint.cs
Tag: 58_25416222083
Line coverage
100%
Covered lines: 6
Uncovered lines: 0
Coverable lines: 6
Total lines: 24
Line coverage: 100%
Branch coverage
100%
Covered branches: 2
Total branches: 2
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_Route()100%11100%
get_Handler()100%22100%
Handle()100%11100%

File(s)

/home/runner/work/ClutterStock/ClutterStock/backend/src/Domain/Features/Locations/GetLocations/GetLocationsEndpoint.cs

#LineLine coverage
 1using ClutterStock.Contracts.Locations;
 2using ClutterStock.Domain.Abstractions;
 3using ClutterStock.Domain.Extensions;
 4using Microsoft.AspNetCore.Http;
 5using Microsoft.AspNetCore.Http.HttpResults;
 6
 7namespace ClutterStock.Domain.Features.Locations.GetLocations;
 8
 9[HttpMethod(HttpVerb.Get)]
 10[OpenApiDescription("Returns all locations.")]
 11public class GetLocationsEndpoint : IEndpoint
 12{
 313    public static string Route => "/locations";
 14
 315    public static Delegate Handler => (Func<IGetLocationsQueryHandler, CancellationToken, Task<Ok<IReadOnlyList<Location
 16
 17    private static async Task<Ok<IReadOnlyList<LocationResponse>>> Handle(IGetLocationsQueryHandler handler,
 18                                                                          CancellationToken cancellationToken)
 19    {
 120        var locations = await handler.HandleAsync(cancellationToken);
 121        return TypedResults.Ok((IReadOnlyList<LocationResponse>) locations.Select(l => l.ToResponse())
 122                                                                          .ToList());
 123    }
 24}

Methods/Properties

get_Route()
get_Handler()
Handle()