< Summary

Information
Class: Services.ApiServices.OzonApi.OzonReportInfoParsing
Assembly: Services
File(s): /home/runner/work/Studio2Prod/Studio2Prod/AppRepository/ApiServices/OzonApi/OzonReportInfoParsing.cs
Line coverage
100%
Covered lines: 4
Uncovered lines: 0
Coverable lines: 4
Total lines: 21
Line coverage: 100%
Branch coverage
100%
Covered branches: 6
Total branches: 6
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
ParseResult(...)100%66100%

File(s)

/home/runner/work/Studio2Prod/Studio2Prod/AppRepository/ApiServices/OzonApi/OzonReportInfoParsing.cs

#LineLine coverage
 1using Newtonsoft.Json.Linq;
 2using Services.ApiServices.OzonApi.Filters;
 3
 4namespace Services.ApiServices.OzonApi;
 5
 6/// <summary>Парсинг ответа POST /v1/report/info.</summary>
 7public static class OzonReportInfoParsing
 8{
 9    public const string SuccessSample =
 10        """
 11        {"result":{"code":"REPORT_seller_stocks_482702_1782279703_019ef826-0b0e-785c-99f7-017dba69c25d","status":"succes
 12        """;
 13
 14    public static ReportInfoResponseResult? ParseResult(JToken? response)
 15    {
 716        if (response == null) return null;
 517        var result = response["result"];
 718        if (result == null || result.Type == JTokenType.Null) return null;
 319        return result.ToObject<ReportInfoResponseResult>();
 20    }
 21}