< Summary

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

Metrics

MethodLine coverage Branch coverage
.ctor()0%100%
.ctor(...)0%0%
get_Id()0%100%
get_ParentId()0%100%
get_ParentCode()0%100%
get_Name()0%100%
get_Code()0%100%
get_Expandable()0%100%
get_GoogleProductCategoryCode()0%100%
get_ExcludeFromYandexFeed()0%100%
get_ExcludeFromGoogleFeed()0%100%
get_Children()0%100%

File(s)

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

#LineLine coverage
 1using System;
 2using System.Collections.Generic;
 3using System.Linq;
 4using System.Threading.Tasks;
 5using System.ComponentModel.DataAnnotations;
 6using WinSolutions.Sveta.Server.Data.DataModel.Entities;
 7
 8namespace SVETA.Api.Data.DTO
 9{
 10    public class CategoryResponseDTO
 11    {
 012        public CategoryResponseDTO()
 013        {
 14
 015        }
 16
 017        public CategoryResponseDTO(Category x)
 018        {
 019            ParentId = x.Parent == null ? 0 : x.Parent.Id;
 020            ParentCode = x.Parent?.Code;
 021            Code = x.Code;
 022            Name = x.Name;
 023            Id = x.Id;
 024            GoogleProductCategoryCode = x.GoogleProductCategoryCode;
 025            ExcludeFromGoogleFeed = x.ExcludeFromGoogleFeed;
 026            ExcludeFromYandexFeed = x.ExcludeFromYandexFeed;
 027        }
 28
 029        public long Id { get; set; }
 30
 031        public long ParentId { get; set; }
 32
 033        public string ParentCode { get; set; }
 34
 035        public string Name { get; set; }
 36
 037        public string Code { get; set; }
 38
 039        public  bool Expandable { get; set; }
 40
 041        public string GoogleProductCategoryCode { get; set; }
 42
 043        public bool ExcludeFromYandexFeed { get; set; }
 44
 045        public bool ExcludeFromGoogleFeed { get; set; }
 46
 047        public List<CategoryResponseDTO> Children { get; set; } = new List<CategoryResponseDTO>();
 48    }
 49
 50    public class CategoryRequestDTO
 51    {
 52        public long ParentId { get; set; }
 53
 54        [NotNullOrWhiteSpaceValidator]
 55        public string Name { get; set; }
 56
 57        [NotNullOrWhiteSpaceValidator]
 58        public string Code { get; set; }
 59
 60        public string GoogleProductCategoryCode { get; set; }
 61        public bool ExcludeFromYandexFeed { get; set; }
 62        public bool ExcludeFromGoogleFeed { get; set; }
 63    }
 64
 65    public class CategoryForFeedDTO
 66    {
 67        public CategoryForFeedDTO() { }
 68
 69        public CategoryForFeedDTO(Category x)
 70        {
 71            Id = x.Id;
 72            Name = x.Name;
 73            GoogleProductCategoryCode = x.GoogleProductCategoryCode;
 74            ExcludeFromGoogleFeed = x.ExcludeFromGoogleFeed;
 75            ExcludeFromYandexFeed = x.ExcludeFromYandexFeed;
 76        }
 77
 78        public long Id { get; set; }
 79        public string Name { get; set; }
 80        public bool ExcludeFromYandexFeed { get; set; }
 81        public bool ExcludeFromGoogleFeed { get; set; }
 82        public string GoogleProductCategoryCode { get; set; }
 83    }
 84}