< Summary

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

Metrics

MethodLine coverage Branch coverage
.ctor()0%100%
.ctor(...)0%100%
get_Id()0%100%
get_Name()0%100%
get_ExcludeFromYandexFeed()0%100%
get_ExcludeFromGoogleFeed()0%100%
get_GoogleProductCategoryCode()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    {
 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    {
 067        public CategoryForFeedDTO() { }
 68
 069        public CategoryForFeedDTO(Category x)
 070        {
 071            Id = x.Id;
 072            Name = x.Name;
 073            GoogleProductCategoryCode = x.GoogleProductCategoryCode;
 074            ExcludeFromGoogleFeed = x.ExcludeFromGoogleFeed;
 075            ExcludeFromYandexFeed = x.ExcludeFromYandexFeed;
 076        }
 77
 078        public long Id { get; set; }
 079        public string Name { get; set; }
 080        public bool ExcludeFromYandexFeed { get; set; }
 081        public bool ExcludeFromGoogleFeed { get; set; }
 082        public string GoogleProductCategoryCode { get; set; }
 83    }
 84}