< Summary

Information
Class: Services.ApiServices.TelegramBotApi.OrdersGridLinks
Assembly: Services
File(s): /home/runner/work/Studio2Prod/Studio2Prod/AppRepository/ApiServices/TelegramBotApi/OrdersGridLinks.cs
Line coverage
100%
Covered lines: 9
Uncovered lines: 0
Coverable lines: 9
Total lines: 22
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
ByShipmentNumber(...)100%11100%

File(s)

/home/runner/work/Studio2Prod/Studio2Prod/AppRepository/ApiServices/TelegramBotApi/OrdersGridLinks.cs

#LineLine coverage
 1using System.Text;
 2using System.Text.Json;
 3
 4namespace Services.ApiServices.TelegramBotApi;
 5
 6/// <summary>Ссылки на сетку заказов с уже применённым фильтром (формат параметра <c>?v=</c> — как у «Ссылки на вид»).</
 7public static class OrdersGridLinks
 8{
 9    /// <summary>Сетка заказов, отфильтрованная по номеру отправления (текстовый фильтр «содержит»).</summary>
 10    public static string ByShipmentNumber(string shipmentNumber)
 11    {
 7312        var json = JsonSerializer.Serialize(new
 7313        {
 7314            f = new
 7315            {
 7316                shipmentNumber = new { filterType = "text", type = "contains", filter = shipmentNumber }
 7317            }
 7318        });
 7319        var v = Convert.ToBase64String(Encoding.UTF8.GetBytes(json)).TrimEnd('=').Replace('+', '-').Replace('/', '_');
 7320        return "/Studio2/OrdersGrid?v=" + v;
 21    }
 22}

Methods/Properties

ByShipmentNumber(System.String)