< Summary

Class:DCL.ConfirmationPopup.ConfirmationPopupHUDComponentView
Assembly:ConfirmationPopup
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/ConfirmationPopup/ConfirmationPopupHUDComponentView.cs
Covered lines:10
Uncovered lines:0
Coverable lines:10
Total lines:39
Line coverage:100% (10 of 10)
Covered branches:0
Total branches:0

Metrics

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

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/ConfirmationPopup/ConfirmationPopupHUDComponentView.cs

#LineLine coverage
 1using System;
 2using TMPro;
 3using UIComponents.Scripts.Components;
 4using UnityEngine;
 5
 6namespace DCL.ConfirmationPopup
 7{
 8    public class ConfirmationPopupHUDComponentView : BaseComponentView<ConfirmationPopupHUDViewModel>, IConfirmationPopu
 9    {
 10        [SerializeField] internal TMP_Text titleLabel;
 11        [SerializeField] internal TMP_Text bodyLabel;
 12        [SerializeField] internal TMP_Text confirmLabel;
 13        [SerializeField] internal TMP_Text cancelLabel;
 14        [SerializeField] internal ButtonComponentView confirmButton;
 15        [SerializeField] internal ButtonComponentView cancelButton;
 16
 17        public event Action OnConfirm;
 18        public event Action OnCancel;
 19
 20        public static ConfirmationPopupHUDComponentView Create() =>
 421            Instantiate(Resources.Load<ConfirmationPopupHUDComponentView>("GenericConfirmationPopup"));
 22
 23        public override void Awake()
 24        {
 425            base.Awake();
 26
 527            confirmButton.onClick.AddListener(() => OnConfirm?.Invoke());
 528            cancelButton.onClick.AddListener(() => OnCancel?.Invoke());
 429        }
 30
 31        public override void RefreshControl()
 32        {
 233            titleLabel.text = model.Title;
 234            bodyLabel.text = model.Body;
 235            confirmLabel.text = model.ConfirmButton;
 236            cancelLabel.text = model.CancelButton;
 237        }
 38    }
 39}

Methods/Properties

Create()
Awake()
RefreshControl()