< Summary - pva.SuperV

Information
Class: pva.SuperV.Api.Routes.FieldDefinitions.GetFieldDefinition
Assembly: pva.SuperV.Api
File(s): /home/runner/work/pva.SuperV/pva.SuperV/pva.SuperV.Api/Routes/FieldDefinitions/GetFieldDefinition.cs
Tag: dotnet-ubuntu_18869653307
Line coverage
72%
Covered lines: 8
Uncovered lines: 3
Coverable lines: 11
Total lines: 28
Line coverage: 72.7%
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%1172.72%

File(s)

/home/runner/work/pva.SuperV/pva.SuperV/pva.SuperV.Api/Routes/FieldDefinitions/GetFieldDefinition.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 GetFieldDefinition
 9    {
 10        internal static async Task<Results<Ok<FieldDefinitionModel>, NotFound<string>, BadRequest<string>>>
 11            Handle(IFieldDefinitionService fieldDefinitionService, string projectId, string className, string fieldName)
 1312        {
 13            try
 1314            {
 1315                FieldDefinitionModel fieldDefinitionModel = await fieldDefinitionService.GetFieldAsync(projectId, classN
 1216                return TypedResults.Ok<FieldDefinitionModel>(fieldDefinitionModel);
 17            }
 118            catch (UnknownEntityException e)
 119            {
 120                return TypedResults.NotFound(e.Message);
 21            }
 022            catch (SuperVException e)
 023            {
 024                return TypedResults.BadRequest(e.Message);
 25            }
 1326        }
 27    }
 28}

Methods/Properties

Handle()