< Summary

Information
Class: OzonDomains.EnumExtensions
Assembly: OzonDomains
File(s): /home/runner/work/Studio2Prod/Studio2Prod/OzonDomains/TransactionType.cs
Line coverage
100%
Covered lines: 4
Uncovered lines: 0
Coverable lines: 4
Total lines: 66
Line coverage: 100%
Branch coverage
50%
Covered branches: 2
Total branches: 4
Branch coverage: 50%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
GetDisplayName(...)50%44100%

File(s)

/home/runner/work/Studio2Prod/Studio2Prod/OzonDomains/TransactionType.cs

#LineLine coverage
 1using System;
 2using System.Collections.Generic;
 3using System.ComponentModel.DataAnnotations;
 4using System.Linq;
 5using System.Reflection;
 6using System.Text;
 7using System.Threading.Tasks;
 8
 9namespace OzonDomains
 10{
 11    public enum TransactionType
 12    {
 13        [Display(Name = "Заказан поставщику")] OrderedToSupplier = 0,
 14
 15        [Display(Name = "Все")] All = 1,
 16
 17        [Display(Name = "Отгружен поставщиком")]
 18        ShippedBySupplier = 2,
 19
 20        [Display(Name = "Отгружен реализатором")]
 21        ShippedToSeller = 3,
 22
 23        [Display(Name = "Заказан реализатору")]
 24        OrderedToSeller = 4,
 25
 26        [Display(Name = "Отгружен клиентом")] ShippedToClient = 6,
 27
 28        [Display(Name = "Проценён")] Percentage = 7,
 29
 30        [Display(Name = "Приходная накладная")]
 31        ReceiptNote = 8,
 32
 33        [Display(Name = "Принят на складе")] AcceptedToWarehouse = 9,
 34
 35        [Display(Name = "К отмене")] ToCancellation = 10,
 36
 37        [Display(Name = "Отменен")] Cancelled = 11,
 38
 39        [Display(Name = "Возврат покупателя")] CustomerReturn = 12,
 40
 41        [Display(Name = "Изменение склада")] WarehouseChange = 13,
 42
 43        [Display(Name = "Возвращено поставщику")] ReturnToSupplier = 14,
 44
 45        [Display(Name = "Возврат на склад")] ReturnToWarehouse = 15,
 46
 47        [Display(Name = "Перемещение между складами")] WarehouseTransfer = 16,
 48
 49        [Display(Name = "Отгружен комиссионеру")] ShippedToCommissioner = 17,
 50
 51        [Display(Name = "Перемещение")] ReturnTransfer = 18,
 52
 53        [Display(Name = "Утерян реализатором")] LostByCommissioner = 19
 54    }
 55
 56    public static class EnumExtensions
 57    {
 58        public static string GetDisplayName(this Enum enumValue)
 59        {
 45460            return enumValue.GetType()
 45461                .GetMember(enumValue.ToString())[0]
 45462                .GetCustomAttribute<DisplayAttribute>()?
 45463                .Name ?? enumValue.ToString();
 64        }
 65    }
 66}

Methods/Properties

GetDisplayName(System.Enum)