< Summary

Class:DCL.Chat.Notifications.ChatNotificationsFeature
Assembly:NotificationMessagesHUD
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/HUD/NotificationMessagesHUD/ChatNotificationsFeature.cs
Covered lines:0
Uncovered lines:13
Coverable lines:13
Total lines:52
Line coverage:0% (0 of 13)
Covered branches:0
Total branches:0
Covered methods:0
Total methods:3
Method coverage:0% (0 of 3)

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
ChatNotificationsFeature()0%2100%
Initialize()0%30500%
Dispose()0%2100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/HUD/NotificationMessagesHUD/ChatNotificationsFeature.cs

#LineLine coverage
 1using DCL.ProfanityFiltering;
 2using DCL.Providers;
 3using DCL.SettingsCommon;
 4using DCL.Social.Chat;
 5using DCL.Social.Friends;
 6using System.Threading;
 7using UnityEngine;
 8
 9namespace DCL.Chat.Notifications
 10{
 11    /// <summary>
 12    /// Plugin feature that initialize the chat notifications feature.
 13    /// </summary>
 14    public class ChatNotificationsFeature : IPlugin
 15    {
 016        private readonly CancellationTokenSource cts = new ();
 17
 18        private ChatNotificationController chatNotificationController;
 19
 020        public ChatNotificationsFeature()
 21        {
 022            Initialize(cts.Token);
 023        }
 24
 25        private async void Initialize(CancellationToken ct)
 26        {
 027            ServiceLocator serviceLocator = Environment.i.serviceLocator;
 28
 029            var chatView = await Environment.i.serviceLocator.Get<IAddressableResourceProvider>()
 30                                        .Instantiate<MainChatNotificationsComponentView>("ChatNotificationHUD", cancella
 31
 032            var notificationView = await Environment.i.serviceLocator.Get<IAddressableResourceProvider>()
 33                                         .Instantiate<TopNotificationComponentView>("TopNotificationHUD", cancellationTo
 34
 035            chatNotificationController = new ChatNotificationController(DataStore.i,
 36                chatView,
 37                notificationView,
 38                serviceLocator.Get<IChatController>(),
 39                serviceLocator.Get<IFriendsController>(),
 40                new UserProfileWebInterfaceBridge(),
 41                serviceLocator.Get<IProfanityFilter>(),
 42                Settings.i.audioSettings);
 043        }
 44
 45        public void Dispose()
 46        {
 047            cts.Cancel();
 048            cts.Dispose();
 049            chatNotificationController.Dispose();
 050        }
 51    }
 52}