< Summary

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

Metrics

MethodLine coverage Branch coverage
get_Name()0%100%
get_ParentId()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]
 015        public string Name { get; set; }
 16
 017        public long ParentId { get; set; }
 18    }
 19
 20    public class BrandOutputDTO
 21    {
 22        public BrandOutputDTO(Brand brand)
 23        {
 24            Id = brand.Id;
 25            Name = brand.Name.Elipsist(200);
 26            if(brand.Parent != null)
 27            {
 28                Parent = new BrandShortOutputDTO(brand.Parent);
 29            }
 30        }
 31
 32        public long Id { get; set; }
 33
 34        public string Name { get; set; }
 35
 36        public BrandShortOutputDTO Parent { get; set; }
 37        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}

Methods/Properties

get_Name()
get_ParentId()