< Summary

Class:DCL.Backpack.WearableGridItemModel
Assembly:BackpackEditorHUDV2
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/HUD/BackpackEditorHUDV2/WearableGridItemModel.cs
Covered lines:13
Uncovered lines:12
Coverable lines:25
Total lines:51
Line coverage:52% (13 of 25)
Covered branches:0
Total branches:0
Covered methods:24
Total methods:25
Method coverage:96% (24 of 25)

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
WearableGridItemModel()0%110100%
Equals(...)0%15.4811066.67%
GetHashCode()0%2100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/HUD/BackpackEditorHUDV2/WearableGridItemModel.cs

#LineLine coverage
 1using DCLServices.WearablesCatalogService;
 2using System;
 3
 4namespace DCL.Backpack
 5{
 6    public record WearableGridItemModel
 7    {
 2078        public string WearableId { get; set; }
 1819        public bool IsSelected { get; set; }
 18910        public bool IsEquipped { get; set; }
 23511        public string ImageUrl { get; set; }
 13812        public string Amount { get; set; }
 17413        public NftRarity Rarity { get; set; }
 17414        public bool IsNew { get; set; }
 14015        public string Category { get; set; }
 16416        public bool UnEquipAllowed { get; set; } = true;
 63217        public bool IsCompatibleWithBodyShape { get; set; } = true;
 14018        public bool IsSmartWearable { get; set; } = false;
 19
 20        public virtual bool Equals(WearableGridItemModel other)
 21        {
 3122            if (ReferenceEquals(null, other)) return false;
 3123            return WearableId == other.WearableId
 24                   && IsSelected == other.IsSelected
 25                   && IsEquipped == other.IsEquipped
 26                   && ImageUrl == other.ImageUrl
 27                   && Rarity == other.Rarity
 28                   && IsNew == other.IsNew
 29                   && Category == other.Category
 30                   && UnEquipAllowed == other.UnEquipAllowed
 31                   && IsCompatibleWithBodyShape == other.IsCompatibleWithBodyShape
 32                   && IsSmartWearable == other.IsSmartWearable;
 33        }
 34
 35        public override int GetHashCode()
 36        {
 037            var hashCode = new HashCode();
 038            hashCode.Add(WearableId);
 039            hashCode.Add(IsSelected);
 040            hashCode.Add(IsEquipped);
 041            hashCode.Add(ImageUrl);
 042            hashCode.Add((int) Rarity);
 043            hashCode.Add(IsNew);
 044            hashCode.Add(Category);
 045            hashCode.Add(UnEquipAllowed);
 046            hashCode.Add(IsCompatibleWithBodyShape);
 047            hashCode.Add(IsSmartWearable);
 048            return hashCode.ToHashCode();
 49        }
 50    }
 51}