< Summary

Class:DCL.Social.Chat.ChannelLeaveErrorWindowComponentView
Assembly:WorldChatWindowHUD
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/HUD/WorldChatWindowHUD/ChannelLeaveErrorWindowComponentView.cs
Covered lines:9
Uncovered lines:1
Coverable lines:10
Total lines:39
Line coverage:90% (9 of 10)
Covered branches:0
Total branches:0
Covered methods:3
Total methods:4
Method coverage:75% (3 of 4)

Metrics

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

File(s)

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

#LineLine coverage
 1using DCL.Social.Chat;
 2using System;
 3using TMPro;
 4using UnityEngine;
 5
 6namespace DCL.Social.Chat
 7{
 8    public class ChannelLeaveErrorWindowComponentView : BaseComponentView, IChannelLeaveErrorWindowView
 9    {
 10        [SerializeField] internal ButtonComponentView[] acceptButton;
 11        [SerializeField] internal ButtonComponentView retryButton;
 12        [SerializeField] internal TMP_Text titleLabel;
 13
 14        public event Action OnClose;
 15        public event Action OnRetry;
 16
 17        public void Show(string channelName)
 18        {
 119            gameObject.SetActive(true);
 120            titleLabel.SetText($"There was an error while trying to leave the channel #{channelName}. Please try again."
 121        }
 22
 123        public void Hide() => gameObject.SetActive(false);
 24
 25        public override void Awake()
 26        {
 427            base.Awake();
 28
 3229            foreach (var button in acceptButton)
 1530                button.onClick.AddListener(() => OnClose?.Invoke());
 31
 532            retryButton.onClick.AddListener(() => OnRetry?.Invoke());
 433        }
 34
 35        public override void RefreshControl()
 36        {
 037        }
 38    }
 39}