< Summary

Class:DCL.Chat.HUD.ChannelLimitReachedWindowController
Assembly:WorldChatWindowHUD
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/HUD/WorldChatWindowHUD/ChannelLimitReachedWindowController.cs
Covered lines:11
Uncovered lines:5
Coverable lines:16
Total lines:39
Line coverage:68.7% (11 of 16)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
ChannelLimitReachedWindowController(...)0%110100%
Dispose()0%6200%
Show(...)0%2.062075%
Close()0%110100%

File(s)

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

#LineLine coverage
 1using System;
 2
 3namespace DCL.Chat.HUD
 4{
 5    public class ChannelLimitReachedWindowController : IDisposable
 6    {
 7        private readonly IChannelLimitReachedWindowView view;
 8        private readonly DataStore dataStore;
 9
 210        public ChannelLimitReachedWindowController(IChannelLimitReachedWindowView view,
 11            DataStore dataStore)
 12        {
 213            this.view = view;
 214            view.Hide();
 215            view.OnClose += Close;
 216            this.dataStore = dataStore;
 217            dataStore.channels.currentChannelLimitReached.OnChange += Show;
 218        }
 19
 20        public void Dispose()
 21        {
 022            dataStore.channels.currentChannelLimitReached.OnChange -= Show;
 23
 024            if (view != null)
 25            {
 026                view.OnClose -= Close;
 027                view.Dispose();
 28            }
 029        }
 30
 31        private void Show(string currentChannelId, string previousChannelId)
 32        {
 233            if (string.IsNullOrEmpty(currentChannelId)) return;
 234            view.Show();
 235        }
 36
 137        private void Close() => view.Hide();
 38    }
 39}