< Summary

Class:SVETA.Api.Services.Implements.DownloadGoodsImagesWorker
Assembly:SVETA.Api
File(s):/opt/dev/sveta_api_build/SVETA.Api/Services/Implements/DownloadGoodsImagesWorker.cs
Covered lines:0
Uncovered lines:11
Coverable lines:11
Total lines:31
Line coverage:0% (0 of 11)
Covered branches:0
Total branches:2
Branch coverage:0% (0 of 2)

Metrics

MethodLine coverage Branch coverage
.ctor(...)0%100%
StartDownload()0%100%
GetDownloadStatus()0%0%

File(s)

/opt/dev/sveta_api_build/SVETA.Api/Services/Implements/DownloadGoodsImagesWorker.cs

#LineLine coverage
 1using SVETA.Api.Data.DTO.Goods;
 2using SVETA.Api.Services.Interfaces;
 3using System;
 4using System.Collections.Generic;
 5using System.Linq;
 6using System.Threading.Tasks;
 7using WinSolutions.Sveta.Server.Services.Interfaces;
 8
 9namespace SVETA.Api.Services.Implements
 10{
 11    public class DownloadGoodsImagesWorker : IDownloadGoodsImagesWorker
 12    {
 13        readonly IDownloadGoodsImagesTaskService _downloadGoodsImagesTaskService;
 14
 015        public DownloadGoodsImagesWorker(IDownloadGoodsImagesTaskService downloadGoodsImagesTaskService)
 016        {
 017            _downloadGoodsImagesTaskService = downloadGoodsImagesTaskService;
 018        }
 19
 20        public async Task<DownloadGoodsImagesStatusDTO> StartDownload(bool activeOnly)
 021        {
 022            return new DownloadGoodsImagesStatusDTO(await _downloadGoodsImagesTaskService.Create(activeOnly));
 023        }
 24
 25        public async Task<DownloadGoodsImagesStatusDTO> GetDownloadStatus()
 026        {
 027            var task = await _downloadGoodsImagesTaskService.FindCurrent();
 028            return task != null ? new DownloadGoodsImagesStatusDTO(task) : new DownloadGoodsImagesStatusDTO();
 029        }
 30    }
 31}