< Summary

Class:WinSolutions.Sveta.Server.Data.DataLoading.Records.ExternalRest
Assembly:WinSolutions.Sveta.Server
File(s):/opt/dev/sveta_api_build/WinSolutions.Sveta.Server/Data/DataLoading/Records/ExternalRest.cs
Covered lines:0
Uncovered lines:23
Coverable lines:23
Total lines:43
Line coverage:0% (0 of 23)
Covered branches:0
Total branches:4
Branch coverage:0% (0 of 4)

Metrics

MethodLine coverage Branch coverage
get_LineNumber()0%100%
get_Line()0%100%
get_Exception()0%100%
get_GoodID()0%100%
get_GoodName()0%100%
get_UniqueCode()0%100%
get_VendorCode()0%100%
GetMapping()0%0%

File(s)

/opt/dev/sveta_api_build/WinSolutions.Sveta.Server/Data/DataLoading/Records/ExternalRest.cs

#LineLine coverage
 1using System;
 2using System.Collections.Generic;
 3using System.Text;
 4using WinSolutions.Sveta.Server.Data.DataLoading.Records;
 5using WinSolutions.Sveta.Server.Data.DataModel.Entities;
 6
 7namespace WinSolutions.Sveta.Server.Data.DataLoading.Records
 8{
 9    public class ExternalRest : Rest, IExternalRecord
 10    {
 11        //DepartmentID,VENDORCODE,NAME,REST
 012        public int LineNumber { get; set; }
 013        public List<string> Line { get; set; } = new List<string>();
 014        public Exception Exception { get; set; }
 15
 016        public string GoodID { get; set; }
 17
 018        public string GoodName { get; set; }
 19
 020        public string UniqueCode { get; set; }
 21
 022        public string VendorCode { get; set; }
 23
 24        public IEnumerable<FieldMap> GetMapping()
 025        {
 026            int x = 0;
 027            var type = this.GetType();
 028            foreach (var p in new[]
 029            {
 030                new {Prop = nameof(UniqueCode), Sample = "ТП{0:D6}", NameRus = "**Уникальный код товара"},
 031                new {Prop = nameof(GoodID), Sample = "{0}", NameRus = "**ID товара"},
 032                new {Prop = nameof(GoodName), Sample = "Название товара {0}", NameRus = "**Название товара"},
 033                new {Prop = nameof(VendorCode), Sample = "{0}", NameRus = "**Артикул"},
 034                new {Prop = nameof(Quantity), Sample = "{0}", NameRus = "*Количество"},
 035            })
 036            {
 037                yield return new FieldMap(x, type.GetProperty(p.Prop)) { SampleData = p.Sample, NameRus = p.NameRus };
 38
 039                x++;
 040            }
 041        }
 42    }
 43}