< Summary

Class:WinSolutions.Sveta.Server.Services.Implements.MovementRouteActionsService
Assembly:WinSolutions.Sveta.Server
File(s):/opt/dev/sveta_api_build/WinSolutions.Sveta.Server/Services/Implements/MovementRouteActionsService.cs
Covered lines:8
Uncovered lines:0
Coverable lines:8
Total lines:37
Line coverage:100% (8 of 8)
Covered branches:0
Total branches:0

Metrics

MethodLine coverage Branch coverage
.ctor(...)100%100%
GetActions()100%100%
GetActions()100%100%

File(s)

/opt/dev/sveta_api_build/WinSolutions.Sveta.Server/Services/Implements/MovementRouteActionsService.cs

#LineLine coverage
 1using System.Collections.Generic;
 2using System.Linq;
 3using System.Threading.Tasks;
 4using Microsoft.EntityFrameworkCore;
 5using Microsoft.Extensions.Logging;
 6using WinSolutions.Sveta.Common;
 7using WinSolutions.Sveta.Server.Data.DataModel.Contexts;
 8using WinSolutions.Sveta.Server.Data.DataModel.Entities;
 9using WinSolutions.Sveta.Server.Services.Interfaces;
 10
 11namespace WinSolutions.Sveta.Server.Services.Implements
 12{
 13    public class MovementRouteActionsService : SvetaServiceBase, IMovementRouteActionsService
 14    {
 15        private readonly ILogger<MovementRouteActionsService> _logger;
 16        private readonly SvetaDbContext _db;
 17        public MovementRouteActionsService(IAuthenticationService authenticationService,
 18            ILogger<MovementRouteActionsService> logger,
 19            SvetaDbContext db
 11420        ) : base(authenticationService)
 11421        {
 11422            _logger = logger;
 11423            _db = db;
 11424        }
 25
 26        /// <summary>
 27        /// Возвращает список доступных действий для документа
 28        /// </summary>
 29        /// <param name="movementStatusId"></param>
 30        /// <returns></returns>
 131        public async Task<List<MovementRouteAction>> GetActions(long movementStatusId) => await _db.MovementRouteActions
 132            .Where(d => !d.IsDeleted && d.StatusId == movementStatusId).ToListAsync();
 33
 34        public async Task<List<MovementRouteAction>> GetActions() =>
 11535            await _db.MovementRouteActions.Where(d => !d.IsDeleted).ToListAsync();
 36    }
 37}

Methods/Properties

.ctor(...)
GetActions()
GetActions()