< 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:27
Uncovered lines:2
Coverable lines:29
Total lines:59
Line coverage:93.1% (27 of 29)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
FriendEntryModel()0%2100%
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 UnityEngine;
 3
 4public class FriendEntryModel
 5{
 6    public string userId;
 7    public PresenceStatus status;
 8    public string userName;
 9    public Vector2 coords;
 10    public string realm;
 11    public string realmServerName;
 12    public string realmLayerName;
 13    public ILazyTextureObserver avatarSnapshotObserver;
 14    public bool blocked;
 15
 016    public FriendEntryModel()
 17    {
 018    }
 19
 120    public FriendEntryModel(FriendEntryModel model)
 21    {
 122        userId = model.userId;
 123        status = model.status;
 124        userName = model.userName;
 125        coords = model.coords;
 126        realm = model.realm;
 127        realmServerName = model.realmServerName;
 128        realmLayerName = model.realmLayerName;
 129        avatarSnapshotObserver = model.avatarSnapshotObserver;
 130        blocked = model.blocked;
 131    }
 32
 33    public virtual void CopyFrom(UserStatus status)
 34    {
 735        userId = status.userId;
 736        this.status = status.presence;
 737        coords = status.position;
 38
 739        if (status.realm != null)
 40        {
 341            realm = $"{status.realm.serverName.ToUpperFirst()} {status.realm.layer.ToUpperFirst()}";
 342            realmServerName = status.realm.serverName;
 343            realmLayerName = status.realm.layer;
 344        }
 45        else
 46        {
 447            realm = string.Empty;
 448            realmServerName = string.Empty;
 449            realmLayerName = string.Empty;
 50        }
 451    }
 52
 53    public virtual void CopyFrom(UserProfile userProfile)
 54    {
 1355        userId = userProfile.userId;
 1356        userName = userProfile.userName;
 1357        avatarSnapshotObserver = userProfile.snapshotObserver;
 1358    }
 59}