< 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
 320    public FriendEntryModel(FriendEntryModel model)
 21    {
 322        userId = model.userId;
 323        status = model.status;
 324        userName = model.userName;
 325        coords = model.coords;
 326        realm = model.realm;
 327        realmServerName = model.realmServerName;
 328        realmLayerName = model.realmLayerName;
 329        avatarSnapshotObserver = model.avatarSnapshotObserver;
 330        blocked = model.blocked;
 331    }
 32
 33    public virtual void CopyFrom(FriendsController.UserStatus status)
 34    {
 935        userId = status.userId;
 936        this.status = status.presence;
 937        coords = status.position;
 38
 939        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        {
 647            realm = string.Empty;
 648            realmServerName = string.Empty;
 649            realmLayerName = string.Empty;
 50        }
 651    }
 52
 53    public virtual void CopyFrom(UserProfile userProfile)
 54    {
 1555        userId = userProfile.userId;
 1556        userName = userProfile.userName;
 1557        avatarSnapshotObserver = userProfile.snapshotObserver;
 1558    }
 59}