< Summary

Class:DCL.GenericConfirmationNotificationData
Assembly:DataStore
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/DataStore/DataStore_Notifications.cs
Covered lines:9
Uncovered lines:2
Coverable lines:11
Total lines:58
Line coverage:81.8% (9 of 11)
Covered branches:0
Total branches:0
Covered methods:2
Total methods:4
Method coverage:50% (2 of 4)

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
GenericConfirmationNotificationData(...)0%110100%
CreateUnFriendData(...)0%2100%
CreateBlockUserData(...)0%110100%
CreateUnBlockUserData(...)0%2100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/DataStore/DataStore_Notifications.cs

#LineLine coverage
 1using System;
 2
 3namespace DCL
 4{
 5    public record GenericConfirmationNotificationData
 6    {
 7        public readonly string Title;
 8        public readonly string Body;
 9        public readonly string CancelButton;
 10        public readonly string ConfirmButton;
 11        public readonly Action CancelAction;
 12        public readonly Action ConfirmAction;
 13
 414        public GenericConfirmationNotificationData(string title, string body, string cancelButton, string confirmButton,
 15            Action cancelAction, Action confirmAction)
 16        {
 417            Title = title;
 418            Body = body;
 419            CancelButton = cancelButton;
 420            ConfirmButton = confirmButton;
 421            CancelAction = cancelAction;
 422            ConfirmAction = confirmAction;
 423        }
 24
 25        public static GenericConfirmationNotificationData CreateUnFriendData(string userName, Action confirmationAction)
 026            new (
 27                $"Are you sure you want to unfriend {userName}?",
 28                "This player and you will no longer be friends, meaning you won't be able to send each other private mes
 29                "CANCEL",
 30                "UNFRIEND",
 31                null,
 32                confirmationAction);
 33
 34        public static GenericConfirmationNotificationData CreateBlockUserData(string userName, Action confirmationAction
 135            new (
 36                $"Are you sure you want to block {userName}?",
 37                "Blocking someone means that you will no longer see their avatar in-world. Both of you will also not see
 38                "CANCEL",
 39                "BLOCK",
 40                null,
 41                confirmationAction);
 42
 43        public static GenericConfirmationNotificationData CreateUnBlockUserData(string userName, Action confirmationActi
 044            new (
 45                $"Are you sure you want to unblock {userName}?",
 46                "Once you unblock someone, you will see their avatar in-world and you will both be able to see each othe
 47                "CANCEL",
 48                "UNBLOCK",
 49                null,
 50                confirmationAction);
 51    }
 52
 53    public class DataStore_Notifications
 54    {
 55        public readonly BaseVariable<string> DefaultErrorNotification = new ();
 56        public readonly BaseVariable<GenericConfirmationNotificationData> GenericConfirmation = new ();
 57    }
 58}