< Summary

Line coverage
73%
Covered lines: 11
Uncovered lines: 4
Coverable lines: 15
Total lines: 27
Line coverage: 73.3%
Branch coverage
0%
Covered branches: 0
Total branches: 2
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity Line coverage
get_Id()100%1100%
get_Name()100%1100%
.ctor()100%1100%
.ctor(...)100%1100%
ToString()100%1100%
CompareTo(...)0%20%

File(s)

/home/rob/github-runner/_work/snacks-bb-g1-weidinger-g1-sinnreich/snacks-bb-g1-weidinger-g1-sinnreich/src/Snacks.Domain/Models/Category.cs

#LineLine coverage
 1using Snacks.Domain.Abstractions;
 2
 3namespace Snacks.Domain.Models
 4{
 5    public class Category : ICategory
 6    {
 967        public int Id { get; set; } = 0;
 868        public string? Name { get; set; }= null;
 9
 9610        public Category() { }
 411        public Category(int id, string name)
 412        {
 413            Id = id;
 414            Name = name;
 415        }
 16        public override string ToString()
 217        {
 218            return $"Category(id:{Id}, Name:{Name})";
 219        }
 20
 21        public int CompareTo(ICategory? other)
 022        {
 023            if (other == null) return 1;
 024            return this.Id.CompareTo(other.Id);
 025        }
 26    }
 27}