< Summary

Class:CollapsableChatSearchListComponentView
Assembly:WorldChatWindowHUD
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/HUD/WorldChatWindowHUD/CollapsableChatSearchListComponentView.cs
Covered lines:29
Uncovered lines:10
Coverable lines:39
Total lines:93
Line coverage:74.3% (29 of 39)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
Initialize(...)0%110100%
Filter(...)0%2100%
Filter(...)0%110100%
Filter(...)0%2100%
Count()0%110100%
Clear(...)0%110100%
Clear()0%2100%
Get(...)0%220100%
Dispose()0%110100%
Remove(...)0%6200%
Set(...)0%110100%
Export(...)0%330100%
Import(...)0%330100%

File(s)

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

#LineLine coverage
 1using System;
 2using UIComponents.CollapsableSortedList;
 3using UnityEngine;
 4
 5public class CollapsableChatSearchListComponentView : CollapsableSortedListComponentView<string, BaseComponentView>
 6{
 7    [SerializeField] private CollapsableDirectChatListComponentView directChatList;
 8    [SerializeField] private CollapsablePublicChannelListComponentView publicChannelList;
 9
 10    public void Initialize(IChatController chatController, ILastReadMessagesService lastReadMessagesService)
 11    {
 2312        directChatList.Initialize(chatController, lastReadMessagesService);
 2313        publicChannelList.Initialize(chatController, lastReadMessagesService);
 2314    }
 15
 16    public void Filter(string search)
 17    {
 018        directChatList.Filter(search);
 019        publicChannelList.Filter(search);
 020    }
 21
 22    public void Filter(Func<PrivateChatEntry, bool> privateComparision,
 23        Func<PublicChannelEntry, bool> publicComparision)
 24    {
 625        directChatList.Filter(privateComparision);
 626        publicChannelList.Filter(publicComparision);
 627    }
 28
 29    public override void Filter(Func<BaseComponentView, bool> comparision)
 30    {
 031        directChatList.Filter(comparision);
 032        publicChannelList.Filter(comparision);
 033    }
 34
 35    public override int Count()
 36    {
 8037        return directChatList.Count() + publicChannelList.Count();
 38    }
 39
 40    public void Clear(bool releaseEntriesFromPool)
 41    {
 342        directChatList.Clear(releaseEntriesFromPool);
 343        publicChannelList.Clear(releaseEntriesFromPool);
 344    }
 45
 46    public override void Clear()
 47    {
 048        directChatList.Clear();
 049        publicChannelList.Clear();
 050    }
 51
 52    public override BaseComponentView Get(string key)
 53    {
 1854        return (BaseComponentView) directChatList.Get(key) ?? publicChannelList.Get(key);
 55    }
 56
 57    public override void Dispose()
 58    {
 359        base.Dispose();
 360        directChatList.Dispose();
 361        publicChannelList.Dispose();
 362    }
 63
 64    public override BaseComponentView Remove(string key)
 65    {
 066        return (BaseComponentView) directChatList.Remove(key) ?? publicChannelList.Remove(key);
 67    }
 68
 869    public void Set(PrivateChatEntry.PrivateChatEntryModel model) => directChatList.Set(model.userId, model);
 70
 71    public void Export(CollapsablePublicChannelListComponentView publicChannelList,
 72        CollapsableDirectChatListComponentView privateChatList)
 73    {
 1274        foreach (var pair in this.publicChannelList.Entries)
 375            publicChannelList.Add(pair.Key, pair.Value);
 2476        foreach (var pair in directChatList.Entries)
 977            privateChatList.Add(pair.Key, pair.Value);
 78
 379        Clear(false);
 380    }
 81
 82    public void Import(CollapsablePublicChannelListComponentView publicChannelList,
 83        CollapsableDirectChatListComponentView privateChatList)
 84    {
 4085        foreach (var pair in privateChatList.Entries)
 1486            directChatList.Add(pair.Key, pair.Value);
 2487        foreach (var pair in publicChannelList.Entries)
 688            this.publicChannelList.Add(pair.Key, pair.Value);
 89
 690        privateChatList.Clear(false);
 691        publicChannelList.Clear(false);
 692    }
 93}