< Summary

Information
Class: OzonDomains.Models.Transaction
Assembly: OzonDomains
File(s): /home/runner/work/Studio2Prod/Studio2Prod/OzonDomains/Models/Transaction.cs
Line coverage
88%
Covered lines: 8
Uncovered lines: 1
Coverable lines: 9
Total lines: 55
Line coverage: 88.8%
Branch coverage
25%
Covered branches: 2
Total branches: 8
Branch coverage: 25%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_Id()100%11100%
get_Type()100%11100%
get_Orders()100%11100%
get_CreateBy()100%11100%
get_CreatedDateTime()100%11100%
get_FormattedCreatedDate()100%11100%
get_FormattedCreatedTime()50%44100%
get_FormattedCreatedTimeDateTime()0%2040%
get_Comment()100%11100%

File(s)

/home/runner/work/Studio2Prod/Studio2Prod/OzonDomains/Models/Transaction.cs

#LineLine coverage
 1using System;
 2using System.Collections.Generic;
 3using System.ComponentModel.DataAnnotations;
 4using System.ComponentModel.DataAnnotations.Schema;
 5using System.Linq;
 6using System.Numerics;
 7using System.Text;
 8using System.Threading.Tasks;
 9
 10namespace OzonDomains.Models
 11{
 12    public class Transaction : ITransaction
 13    {
 27114        public int Id { get; set; }
 15
 16        [Display(Name = "Тип транзакции")]
 16717        public TransactionType? Type {  get; set; }
 18
 19        [Display(Name = "Список заказав в транзакции")]
 20420        public virtual ICollection<Order> Orders { get; set; } = new List<Order>();
 21
 22
 23        [Display(Name = "Пользователь провевший транзакцию")]
 24        [MaxLength(50)]
 15925        public string? CreateBy { get; set; }
 26
 27        [Display(Name = "Дата создания транзакции")]
 26028        public DateTime? CreatedDateTime { get; set; }
 29        public string FormattedCreatedDate
 30        {
 3531            get { return OrderDateDisplay.FormatTableDate(CreatedDateTime); }
 32        }
 33
 34        public string FormattedCreatedTime
 35        {
 36            get
 37            {
 3538                return CreatedDateTime.HasValue ? $"{CreatedDateTime.Value.ToString("HH:mm:ss")}" : "";
 39            }
 40        }
 41
 42        [NotMapped]
 43        public string FormattedCreatedTimeDateTime
 44        {
 45            get
 46            {
 047                return CreatedDateTime.HasValue ? $"{CreatedDateTime.Value.ToString("dd.MM.yyyy HH:mm")}" : "";
 48            }
 49        }
 50
 51        [Display(Name = "Комментарий")]
 52        [Column(TypeName = "longtext")]
 15053        public string? Comment { get; set; }
 54    }
 55}