Summary

Class:ProjectX.PublicApi.Filters.ValidateModelAttribute
Assembly:ProjectX.PublicApi
File(s):C:\private\projects\projectx\backend\src\ProjectX.PublicApi\Filters\ValidateModelAttribute.cs
Covered lines:4
Uncovered lines:0
Coverable lines:4
Total lines:17
Line coverage:100%
Branch coverage:100%

History

Metrics

MethodCyclomatic complexity  NPath complexity  Sequence coverage  Branch coverage  
OnActionExecuting(...)22100100

File(s)

C:\private\projects\projectx\backend\src\ProjectX.PublicApi\Filters\ValidateModelAttribute.cs

#LineLine coverage
 1using Microsoft.AspNetCore.Mvc;
 2using Microsoft.AspNetCore.Mvc.Filters;
 3
 4namespace ProjectX.PublicApi.Filters
 5{
 6    public class ValidateModelAttribute : ActionFilterAttribute
 7    {
 8        public override void OnActionExecuting(ActionExecutingContext context)
 9        {
 1910             if (!context.ModelState.IsValid)
 11            {
 312                context.Result =
 313                    new BadRequestObjectResult(context.ModelState);
 14            }
 1915        }
 16    }
 17}