< Summary

Line coverage
84%
Covered lines: 21
Uncovered lines: 4
Coverable lines: 25
Total lines: 35
Line coverage: 84%
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%
get_Description()100%1100%
get_Price()100%1100%
get_CategoryId()100%1100%
get_RestaurantId()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/Product.cs

#LineLine coverage
 1using Snacks.Domain.Abstractions;
 2
 3namespace Snacks.Domain.Models;
 4
 5public class Product : IProduct
 6{
 1207    public int Id { get; set; } = 0;
 1068    public string? Name { get; set; } = null;
 969    public string? Description { get; set; } = null;
 9810    public decimal Price { get; set; } = 0;
 9611    public int CategoryId { get; set; } = 0;
 9412    public int RestaurantId { get; set; } = 0;
 13
 3814    public Product()
 3815    {
 3816    }
 617    public Product(int id, string name, string description, decimal price, int categoryId, int restaurantId)
 618    {
 619        Id = id;
 620        Name = name;
 621        Description = description;
 622        Price = price;
 623        CategoryId = categoryId;
 624        RestaurantId = restaurantId;
 625    }
 26    public override string ToString()
 227    {
 228        return $"Id: {Id}, Name: {Name}, Description: {Description}, Price: {Price}, CategoryId: {CategoryId}, Restauran
 229    }
 30    public int CompareTo(IProduct? other)
 031    {
 032        if (other == null) return 1;
 033        return this.Id.CompareTo(other.Id);
 034    }
 35}