< Summary

Class:SVETA.Api.Helpers.MovementHelpers
Assembly:SVETA.Api
File(s):/opt/dev/sveta_api_build/SVETA.Api/Helpers/MovementHelpers.cs
Covered lines:10
Uncovered lines:0
Coverable lines:10
Total lines:22
Line coverage:100% (10 of 10)
Covered branches:3
Total branches:4
Branch coverage:75% (3 of 4)

Metrics

MethodLine coverage Branch coverage
CreateLink(...)100%100%
CreatePostfixLink(...)100%75%

File(s)

/opt/dev/sveta_api_build/SVETA.Api/Helpers/MovementHelpers.cs

#LineLine coverage
 1using SVETA.Api.Data.Domain;
 2using WinSolutions.Sveta.Server.Data.DataModel.Entities;
 3using WinSolutions.Sveta.Server.Data.DataModel.Kinds;
 4
 5namespace SVETA.Api.Helpers
 6{
 7    public static class MovementHelpers
 8    {
 9        public static string CreateLink(Movement movement, CommonSettings commonSettings)
 28510        {
 28511            string type = CreatePostfixLink(movement.MovementType);
 28512            return $"<a class='notification-link' href='{commonSettings.BaseFrontUrl}/{type}/{movement.Id}'>{movement.Do
 28513        }
 14
 28515        public static string CreatePostfixLink(MovementType type) =>  type.Id switch
 28516        {
 28517            (long) MovementKind.Order => $"orders",
 28518            (long) MovementKind.Shipment => $"shipments",
 28519            _ => default
 28520        };
 21    }
 22}