< 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
 7817    public FriendEntryModel()
 18    {
 7819    }
 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    {
 736        userId = status.userId;
 737        this.status = status.presence;
 738        coords = status.position;
 39
 740        if (status.realm != null)
 41        {
 342            realm = $"{status.realm.serverName.ToUpperFirst()} {status.realm.layer.ToUpperFirst()}";
 343            realmServerName = status.realm.serverName;
 344            realmLayerName = status.realm.layer;
 45        }
 46        else
 47        {
 448            realm = string.Empty;
 449            realmServerName = string.Empty;
 450            realmLayerName = string.Empty;
 51        }
 452    }
 53
 54    public virtual void CopyFrom(UserProfile userProfile)
 55    {
 1356        userId = userProfile.userId;
 1357        userName = userProfile.userName;
 1358        avatarSnapshotObserver = userProfile.snapshotObserver;
 1359    }
 60}