< Summary

Class:SVETA.Api.Data.DTO.UploadResultDTO
Assembly:SVETA.Api
File(s):/opt/dev/sveta_api_build/SVETA.Api/Data/DTO/UploadResultDTO.cs
Covered lines:0
Uncovered lines:14
Coverable lines:14
Total lines:47
Line coverage:0% (0 of 14)
Covered branches:0
Total branches:4
Branch coverage:0% (0 of 4)

Metrics

MethodLine coverage Branch coverage
.ctor()0%100%
.ctor(...)0%0%
get_succeed()0%100%
get_errorCount()0%100%
get_reportUrl()0%100%
get_uploadId()0%100%

File(s)

/opt/dev/sveta_api_build/SVETA.Api/Data/DTO/UploadResultDTO.cs

#LineLine coverage
 1using System;
 2using System.Collections.Generic;
 3using System.Linq;
 4using System.Threading.Tasks;
 5using WinSolutions.Sveta.Server.Data.DataLoading;
 6
 7namespace SVETA.Api.Data.DTO
 8{
 9    public class UploadResultDTO
 10    {
 011        public UploadResultDTO()
 012        {
 13
 014        }
 15
 016        public UploadResultDTO(LoadingResult res, string baseUrl)
 017        {
 018            succeed = res.Errors == null || !res.Errors.Any();
 019            errorCount = res.Errors == null ? 0 : res.Errors.Count();
 020            reportUrl = $"{baseUrl.TrimEnd('/')}/api/v1/Upload/GetReport?id={res.UploadId}";
 021            uploadId = res.UploadId;
 022        }
 23
 024        public bool succeed { get; set; }
 25
 026        public int errorCount { get; set; }
 27
 028        public string reportUrl { get; set; }
 29
 030        public long uploadId { get; set; }
 31    }
 32
 33    public class UploadStringResultDto : UploadResultDTO
 34    {
 35        public List<string> Result { get; set; }
 36
 37        public UploadStringResultDto() : base()
 38        {
 39
 40        }
 41
 42        public UploadStringResultDto(LoadingResult res, string baseUrl): base (res, baseUrl)
 43        {
 44
 45        }
 46    }
 47}