< Summary

Information
Class: OzonDomains.Models.Supplier
Assembly: OzonDomains
File(s): /home/runner/work/Studio2Prod/Studio2Prod/OzonDomains/Models/Supplier.cs
Line coverage
81%
Covered lines: 13
Uncovered lines: 3
Coverable lines: 16
Total lines: 58
Line coverage: 81.2%
Branch coverage
0%
Covered branches: 0
Total branches: 6
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_Id()100%11100%
get_Name()100%11100%
get_CostFactor()100%11100%
get_WeightFactor()100%11100%
get_CurrencyCode()100%11100%
get_WeightFactorCurrencyCode()100%11100%
get_WeightFactorCurrencyDisplayName()0%4260%
get_CsvUrl()100%11100%
get_Site()100%11100%
get_AdditionalTerm()100%11100%
get_ExpectedDeliveryHours()100%11100%
get_IsVatApplicable()100%11100%
get_INNCode()100%11100%
get_IsReSeller()100%11100%

File(s)

/home/runner/work/Studio2Prod/Studio2Prod/OzonDomains/Models/Supplier.cs

#LineLine coverage
 1using System.ComponentModel.DataAnnotations;
 2using System.ComponentModel.DataAnnotations.Schema;
 3using System.Reflection;
 4
 5namespace OzonDomains.Models
 6{
 7    public class Supplier
 8    {
 2619        public int Id { get; set; }
 10
 11        [StringLength(50)]
 12        [Display(Name = "Поставщик")]
 42613        public string? Name { get; set; }
 14
 15        [Display(Name = "Коэффицент себестоимости")]
 51516        public decimal? CostFactor { get; set; } = 1;
 17
 50318        [Display(Name = "Стоимость за кг")] public decimal? WeightFactor { get; set; } = 1;
 19
 24820        [Display(Name = "Валюта")] public CurrencyCode CurrencyCode { get; set; }
 21
 22        [Display(Name = "Валюта стоимость за кг")]
 10323        public CurrencyCode WeightFactorCurrencyCode { get; set; }
 24
 25        [NotMapped]
 26        public string WeightFactorCurrencyDisplayName
 27        {
 28            get
 29            {
 030                var field = WeightFactorCurrencyCode.GetType().GetField(WeightFactorCurrencyCode.ToString());
 031                var displayAttribute = field?.GetCustomAttribute<DisplayAttribute>();
 032                return displayAttribute?.Name ?? WeightFactorCurrencyCode.ToString();
 33            }
 34        }
 35
 36        [StringLength(500)]
 37        [Display(Name = "CSV URL")]
 9638        public string? CsvUrl { get; set; }
 39
 40        [StringLength(500)]
 41        [Display(Name = "Сайт")]
 12742        public string? Site { get; set; }
 43
 44        [Display(Name = "Дополнительный срок")]
 13745        public int? AdditionalTerm { get; set; }
 46
 47        [Display(Name = "Норматив поставки, ч.")]
 1248        public int? ExpectedDeliveryHours { get; set; }
 49
 10650        [Display(Name = "Облагается НДС")] public bool IsVatApplicable { get; set; } = false;
 51
 52        [MaxLength(20)]
 53        [Display(Name = "ИНН")]
 12554        public string? INNCode { get; set; }
 55
 556        [Display(Name = "Реализатор")] public bool IsReSeller { get; set; } = false;
 57    }
 58}