< Summary

Class:DCL.Chat.HUD.ChannelContextualMenu
Assembly:WorldChatWindowHUD
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/HUD/WorldChatWindowHUD/ChannelContextualMenu.cs
Covered lines:18
Uncovered lines:0
Coverable lines:18
Total lines:60
Line coverage:100% (18 of 18)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
Awake()0%110100%
Show(...)0%110100%
Hide(...)0%110100%
RefreshControl()0%110100%
SetHeaderTitle(...)0%110100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/HUD/WorldChatWindowHUD/ChannelContextualMenu.cs

#LineLine coverage
 1using System;
 2using TMPro;
 3using UnityEngine;
 4using UnityEngine.UI;
 5
 6namespace DCL.Chat.HUD
 7{
 8    public class ChannelContextualMenu : BaseComponentView
 9    {
 10        [Flags]
 11        internal enum Options
 12        {
 13            Leave = 1 << 0
 14        }
 15
 16        [SerializeField] internal Options options;
 17        [SerializeField] internal TMP_Text headerTiler;
 18        [SerializeField] internal Button leaveButton;
 19        [SerializeField] internal Button closeButton;
 20
 21        public event Action OnLeave;
 22
 23        public override void Awake()
 24        {
 625            base.Awake();
 26
 627            leaveButton.onClick.AddListener(() =>
 28            {
 329                OnLeave?.Invoke();
 330                Hide();
 331            });
 32
 733            closeButton.onClick.AddListener(() => Hide());
 34
 635            RefreshControl();
 636        }
 37
 38        public override void Show(bool instant = false)
 39        {
 240            base.Show(instant);
 241            gameObject.SetActive(true);
 242        }
 43
 44        public override void Hide(bool instant = false)
 45        {
 446            base.Hide(instant);
 447            gameObject.SetActive(false);
 448        }
 49
 50        public override void RefreshControl()
 51        {
 652            leaveButton.gameObject.SetActive((options & Options.Leave) != 0);
 653        }
 54
 55        public void SetHeaderTitle(string title)
 56        {
 457            headerTiler.text = title;
 458        }
 59    }
 60}