< Summary

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

Metrics

MethodLine coverage Branch coverage
get_ParentId()0%100%
get_Name()0%100%
get_Code()0%100%
get_GoogleProductCategoryCode()0%100%
get_ExcludeFromYandexFeed()0%100%
get_ExcludeFromGoogleFeed()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    {
 12        public CategoryResponseDTO()
 13        {
 14
 15        }
 16
 17        public CategoryResponseDTO(Category x)
 18        {
 19            ParentId = x.Parent == null ? 0 : x.Parent.Id;
 20            ParentCode = x.Parent?.Code;
 21            Code = x.Code;
 22            Name = x.Name;
 23            Id = x.Id;
 24            GoogleProductCategoryCode = x.GoogleProductCategoryCode;
 25            ExcludeFromGoogleFeed = x.ExcludeFromGoogleFeed;
 26            ExcludeFromYandexFeed = x.ExcludeFromYandexFeed;
 27        }
 28
 29        public long Id { get; set; }
 30
 31        public long ParentId { get; set; }
 32
 33        public string ParentCode { get; set; }
 34
 35        public string Name { get; set; }
 36
 37        public string Code { get; set; }
 38
 39        public  bool Expandable { get; set; }
 40
 41        public string GoogleProductCategoryCode { get; set; }
 42
 43        public bool ExcludeFromYandexFeed { get; set; }
 44
 45        public bool ExcludeFromGoogleFeed { get; set; }
 46
 47        public List<CategoryResponseDTO> Children { get; set; } = new List<CategoryResponseDTO>();
 48    }
 49
 50    public class CategoryRequestDTO
 51    {
 052        public long ParentId { get; set; }
 53
 54        [NotNullOrWhiteSpaceValidator]
 055        public string Name { get; set; }
 56
 57        [NotNullOrWhiteSpaceValidator]
 058        public string Code { get; set; }
 59
 060        public string GoogleProductCategoryCode { get; set; }
 061        public bool ExcludeFromYandexFeed { get; set; }
 062        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}