< Summary

Class:DCL.Backpack.NftSubCategoryFilterComponentView
Assembly:BackpackEditorHUDV2
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/HUD/BackpackEditorHUDV2/NftSubCategoryFilterComponentView.cs
Covered lines:15
Uncovered lines:0
Coverable lines:15
Total lines:53
Line coverage:100% (15 of 15)
Covered branches:0
Total branches:0
Covered methods:3
Total methods:3
Method coverage:100% (3 of 3)

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
Awake()0%110100%
RefreshControl()0%880100%

File(s)

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

#LineLine coverage
 1using System;
 2using TMPro;
 3using UIComponents.Scripts.Components;
 4using UnityEngine;
 5using UnityEngine.UI;
 6
 7namespace DCL.Backpack
 8{
 9    public class NftSubCategoryFilterComponentView : BaseComponentView<NftSubCategoryFilterModel>
 10    {
 11        [SerializeField] internal Button navigateButton;
 12        [SerializeField] internal Button exitButton;
 13        [SerializeField] internal TMP_Text categoryName;
 14        [SerializeField] internal Image icon;
 15        [SerializeField] internal Image backgroundImage;
 16        [SerializeField] internal Color selectedBackgroundColor;
 17        [SerializeField] internal Color selectedFontColor;
 18        [SerializeField] internal Color unselectedBackgroundColor;
 19        [SerializeField] internal Color unselectedFontColor;
 20        [SerializeField] internal Color selectedIconColor;
 21        [SerializeField] internal Color unselectedIconColor;
 22
 23        public event Action<NftSubCategoryFilterModel> OnNavigate;
 24        public event Action<NftSubCategoryFilterModel> OnExit;
 25
 326        public NftSubCategoryFilterModel Model => model;
 27
 28        public override void Awake()
 29        {
 4830            base.Awake();
 31
 4832            navigateButton.onClick.AddListener(() => OnNavigate?.Invoke(model));
 4833            exitButton.onClick.AddListener(() => OnExit?.Invoke(model));
 4834        }
 35
 36        public override void RefreshControl()
 37        {
 1238            categoryName.text = model.Name;
 39
 1240            if (model.ShowResultCount)
 541                categoryName.text += $" ({model.ResultCount})";
 42
 1243            exitButton.gameObject.SetActive(model.ShowRemoveButton);
 44
 1245            icon.sprite = model.Icon;
 1246            icon.gameObject.SetActive(model.Icon != null);
 47
 1248            backgroundImage.color = model.IsSelected ? selectedBackgroundColor : unselectedBackgroundColor;
 1249            categoryName.color = model.IsSelected ? selectedFontColor : unselectedFontColor;
 1250            icon.color = model.IsSelected ? selectedIconColor : unselectedIconColor;
 1251        }
 52    }
 53}

Methods/Properties

Model()
Awake()
RefreshControl()