< Summary

Information
Class: Services.ParserServices.FullDetailInfoCaster
Assembly: Services
File(s): /home/runner/work/Studio2Prod/Studio2Prod/AppRepository/ParserServices/FullDetailInfoCaster.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 14
Coverable lines: 14
Total lines: 31
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 20
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
CastToFullDetailInfoSchema()0%420200%

File(s)

/home/runner/work/Studio2Prod/Studio2Prod/AppRepository/ParserServices/FullDetailInfoCaster.cs

#LineLine coverage
 1using Newtonsoft.Json.Linq;
 2using OzonDomains.TecDocModels;
 3using Services.ApiServices.TecDocApi.Models;
 4
 5namespace Services.ParserServices
 6{
 7    public class FullDetailInfoCaster
 8    {
 9        public async Task<FullDetailInfoSchema> CastToFullDetailInfoSchema(JObject json)
 10        {
 011            var result = new FullDetailInfoSchema
 012            {
 013                NormalizedArticle = json["normalized_article"]?.ToString(),
 014                DetailAttribute = json["detail_attribute"]?.ToObject<List<ArticleAttributesSchema>>() ?? new List<Articl
 015                ImgUrls = json["img_urls"]?.ToObject<List<string>>() ?? new List<string>(),
 016                SupplierFromJc = json["supplier_from_jc"]?.ToObject<EtProducerSchema>(),
 017                SupplierFromTd = json["supplier_from_td"]?.ToObject<SuppliersSchema>()
 018            };
 19
 020            result.SupplierFromJc ??= null;
 021            result.SupplierFromTd ??= null;
 22
 023            if (result.ImgUrls.Count == 0)
 24            {
 025                result.ImgUrls = Enumerable.Repeat("https://s3.timeweb.cloud/25f554fc-6f66254e-9650-4d17-8e13-77b5b7d324
 26            }
 27
 028            return await Task.FromResult(result);
 029        }
 30    }
 31}

Methods/Properties

CastToFullDetailInfoSchema()