< Summary

Class:FriendEntryModel
Assembly:FriendsHUD
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/HUD/FriendsHUD/Scripts/Entries/FriendEntryModel.cs
Covered lines:28
Uncovered lines:0
Coverable lines:28
Total lines:60
Line coverage:100% (28 of 28)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
FriendEntryModel()0%110100%
FriendEntryModel(...)0%110100%
CopyFrom(...)0%220100%
CopyFrom(...)0%110100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/HUD/FriendsHUD/Scripts/Entries/FriendEntryModel.cs

#LineLine coverage
 1using DCL.Helpers;
 2using DCL.Social.Friends;
 3using UnityEngine;
 4
 5public class FriendEntryModel
 6{
 7    public string userId;
 8    public PresenceStatus status;
 9    public string userName;
 10    public Vector2 coords;
 11    public string realm;
 12    public string realmServerName;
 13    public string realmLayerName;
 14    public ILazyTextureObserver avatarSnapshotObserver;
 15    public bool blocked;
 16
 7417    public FriendEntryModel()
 18    {
 7419    }
 20
 121    public FriendEntryModel(FriendEntryModel model)
 22    {
 123        userId = model.userId;
 124        status = model.status;
 125        userName = model.userName;
 126        coords = model.coords;
 127        realm = model.realm;
 128        realmServerName = model.realmServerName;
 129        realmLayerName = model.realmLayerName;
 130        avatarSnapshotObserver = model.avatarSnapshotObserver;
 131        blocked = model.blocked;
 132    }
 33
 34    public virtual void CopyFrom(UserStatus status)
 35    {
 336        userId = status.userId;
 337        this.status = status.presence;
 338        coords = status.position;
 39
 340        if (status.realm != null)
 41        {
 142            realm = $"{status.realm.serverName.ToUpperFirst()} {status.realm.layer.ToUpperFirst()}";
 143            realmServerName = status.realm.serverName;
 144            realmLayerName = status.realm.layer;
 45        }
 46        else
 47        {
 248            realm = string.Empty;
 249            realmServerName = string.Empty;
 250            realmLayerName = string.Empty;
 51        }
 252    }
 53
 54    public virtual void CopyFrom(UserProfile userProfile)
 55    {
 1556        userId = userProfile.userId;
 1557        userName = userProfile.userName;
 1558        avatarSnapshotObserver = userProfile.snapshotObserver;
 1559    }
 60}