< Summary

Class:NotificationHUDView
Assembly:NotificationHUD
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/HUD/NotificationHUD/NotificationHUDView.cs
Covered lines:12
Uncovered lines:3
Coverable lines:15
Total lines:43
Line coverage:80% (12 of 15)
Covered branches:0
Total branches:0
Covered methods:4
Total methods:5
Method coverage:80% (4 of 5)

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
ShowNotification(...)0%3.043083.33%
ShowNotification(...)0%2.022083.33%
OnNotificationDismissed(...)0%220100%
SetActive(...)0%110100%
Dispose()0%2100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/HUD/NotificationHUD/NotificationHUDView.cs

#LineLine coverage
 1using System;
 2using DCL.NotificationModel;
 3using UnityEngine;
 4
 5public class NotificationHUDView : MonoBehaviour, IDisposable
 6{
 7    public NotificationFactory notificationFactory;
 8
 9    [SerializeField]
 10    private RectTransform notificationPanel;
 11
 12    public event Action<INotification> OnNotificationDismissedEvent;
 13
 14    public void ShowNotification(INotification notification, Model model = null)
 15    {
 416        if (notification == null)
 017            return;
 18
 419        notification.OnNotificationDismissed += OnNotificationDismissed;
 20
 421        if (model != null)
 422            notification.Show(model);
 423    }
 24
 25    public Notification ShowNotification(Model notificationModel)
 26    {
 427        if (notificationModel == null)
 028            return null;
 29
 430        Notification notification = notificationFactory.CreateNotificationFromType(notificationModel.type, notificationP
 431        notificationModel.destroyOnFinish = true;
 432        ShowNotification(notification, notificationModel);
 433        return notification;
 34    }
 35
 236    private void OnNotificationDismissed(INotification notification) { OnNotificationDismissedEvent?.Invoke(notification
 37
 238    public void SetActive(bool active) { gameObject.SetActive(active); }
 39
 40    public void Dispose()
 41    {
 042    }
 43}