< Summary

Class:SVETA.Api.Data.DTO.PhotoPrevDto
Assembly:SVETA.Api
File(s):/opt/dev/sveta_api_build/SVETA.Api/Data/DTO/PhotoDTO.cs
Covered lines:6
Uncovered lines:3
Coverable lines:9
Total lines:39
Line coverage:66.6% (6 of 9)
Covered branches:3
Total branches:6
Branch coverage:50% (3 of 6)

Metrics

MethodLine coverage Branch coverage
get_PreviewWidth()0%100%
get_PreviewHeight()0%100%
get_PreviewUrl()0%100%
op_Explicit(...)100%50%

File(s)

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

#LineLine coverage
 1using System.ComponentModel.DataAnnotations;
 2using WinSolutions.Sveta.Server.Data.DataModel.Entities;
 3
 4namespace SVETA.Api.Data.DTO
 5{
 6    public class PhotoDTO
 7    {
 8        public string PreviewUrl { get; set; }
 9
 10        public string FullSizeUrl { get; set; }
 11        public int PreviewWidth{get;set;}
 12        public int PreviewHeight{get;set;}
 13
 14        public int FullSizeWidth{get;set;}
 15        public int FullSizeHeight{get;set;}
 16        public static explicit operator PhotoDTO(Photo photo) => new PhotoDTO
 17        {
 18            PreviewUrl = photo?.PreviewUrl,
 19            FullSizeUrl = photo?.FullSizeUrl,
 20            PreviewWidth = photo?.PreviewWidth ?? 0,
 21            PreviewHeight = photo?.PreviewHeight ?? 0,
 22            FullSizeHeight = photo?.FullSizeHeight ?? 0,
 23            FullSizeWidth = photo?.FullSizeWidth ?? 0
 24        };
 25    }
 26
 27    public class PhotoPrevDto
 28    {
 029        public int PreviewWidth{get;set;}
 030        public int PreviewHeight{get;set;}
 031        public string PreviewUrl { get; set; }
 1132        public static explicit operator PhotoPrevDto(Photo photo) => new PhotoPrevDto
 1133        {
 1134            PreviewUrl = photo?.PreviewUrl,
 1135            PreviewWidth = photo?.PreviewWidth ?? 0,
 1136            PreviewHeight = photo?.PreviewHeight ?? 0,
 1137        };
 38    }
 39}