< Summary

Class:SVETA.Api.Data.DTO.BrandOutputDTO
Assembly:SVETA.Api
File(s):/opt/dev/sveta_api_build/SVETA.Api/Data/DTO/BrandDTO.cs
Covered lines:0
Uncovered lines:13
Coverable lines:13
Total lines:52
Line coverage:0% (0 of 13)
Covered branches:0
Total branches:2
Branch coverage:0% (0 of 2)

Metrics

MethodLine coverage Branch coverage
.ctor(...)0%0%
get_Id()0%100%
get_Name()0%100%
get_Parent()0%100%
get_Expandable()0%100%

File(s)

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

#LineLine coverage
 1using System;
 2using System.ComponentModel.DataAnnotations;
 3using System.Collections.Generic;
 4using System.Linq;
 5using System.Threading.Tasks;
 6using WinSolutions.Sveta.Server.Data.DataModel.Entities;
 7using SVETA.Api.Helpers;
 8using WinSolutions.Sveta.Common.Extensions;
 9
 10namespace SVETA.Api.Data.DTO
 11{
 12    public class BrandInputDTO
 13    {
 14        [NotNullOrWhiteSpaceValidator]
 15        public string Name { get; set; }
 16
 17        public long ParentId { get; set; }
 18    }
 19
 20    public class BrandOutputDTO
 21    {
 022        public BrandOutputDTO(Brand brand)
 023        {
 024            Id = brand.Id;
 025            Name = brand.Name.Elipsist(200);
 026            if(brand.Parent != null)
 027            {
 028                Parent = new BrandShortOutputDTO(brand.Parent);
 029            }
 030        }
 31
 032        public long Id { get; set; }
 33
 034        public string Name { get; set; }
 35
 036        public BrandShortOutputDTO Parent { get; set; }
 037        public bool Expandable { get; set; }
 38    }
 39
 40    public class BrandShortOutputDTO
 41    {
 42        public BrandShortOutputDTO(Brand brand)
 43        {
 44            Id = brand.Id;
 45            Name = brand.Name.Elipsist(200);
 46        }
 47
 48        public long Id { get; set; }
 49
 50        public string Name { get; set; }
 51    }
 52}