< Summary - pva.SuperV

Information
Class: pva.SuperV.Api.Routes.FieldDefinitions.GetFieldDefinitions
Assembly: pva.SuperV.Api
File(s): /home/runner/work/pva.SuperV/pva.SuperV/pva.SuperV.Api/Routes/FieldDefinitions/GetFieldDefinitions.cs
Tag: dotnet-ubuntu_18869653307
Line coverage
70%
Covered lines: 7
Uncovered lines: 3
Coverable lines: 10
Total lines: 27
Line coverage: 70%
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
Handle()100%1170%

File(s)

/home/runner/work/pva.SuperV/pva.SuperV/pva.SuperV.Api/Routes/FieldDefinitions/GetFieldDefinitions.cs

#LineLine coverage
 1using Microsoft.AspNetCore.Http.HttpResults;
 2using pva.SuperV.Engine.Exceptions;
 3using pva.SuperV.Model.FieldDefinitions;
 4using pva.SuperV.Model.Services;
 5
 6namespace pva.SuperV.Api.Routes.FieldDefinitions
 7{
 8    internal static class GetFieldDefinitions
 9    {
 10        internal static async Task<Results<Ok<List<FieldDefinitionModel>>, NotFound<string>, BadRequest<string>>>
 11            Handle(IFieldDefinitionService fieldDefinitionService, string projectId, string className)
 212        {
 13            try
 214            {
 215                return TypedResults.Ok(await fieldDefinitionService.GetFieldsAsync(projectId, className));
 16            }
 117            catch (UnknownEntityException e)
 118            {
 119                return TypedResults.NotFound(e.Message);
 20            }
 021            catch (SuperVException e)
 022            {
 023                return TypedResults.BadRequest(e.Message);
 24            }
 225        }
 26    }
 27}

Methods/Properties

Handle()