< 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:2
Uncovered lines:26
Coverable lines:28
Total lines:60
Line coverage:7.1% (2 of 28)
Covered branches:0
Total branches:0
Covered methods:1
Total methods:4
Method coverage:25% (1 of 4)

Metrics

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

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
 317    public FriendEntryModel()
 18    {
 319    }
 20
 021    public FriendEntryModel(FriendEntryModel model)
 22    {
 023        userId = model.userId;
 024        status = model.status;
 025        userName = model.userName;
 026        coords = model.coords;
 027        realm = model.realm;
 028        realmServerName = model.realmServerName;
 029        realmLayerName = model.realmLayerName;
 030        avatarSnapshotObserver = model.avatarSnapshotObserver;
 031        blocked = model.blocked;
 032    }
 33
 34    public virtual void CopyFrom(UserStatus status)
 35    {
 036        userId = status.userId;
 037        this.status = status.presence;
 038        coords = status.position;
 39
 040        if (status.realm != null)
 41        {
 042            realm = $"{status.realm.serverName.ToUpperFirst()} {status.realm.layer.ToUpperFirst()}";
 043            realmServerName = status.realm.serverName;
 044            realmLayerName = status.realm.layer;
 45        }
 46        else
 47        {
 048            realm = string.Empty;
 049            realmServerName = string.Empty;
 050            realmLayerName = string.Empty;
 51        }
 052    }
 53
 54    public virtual void CopyFrom(UserProfile userProfile)
 55    {
 056        userId = userProfile.userId;
 057        userName = userProfile.userName;
 058        avatarSnapshotObserver = userProfile.snapshotObserver;
 059    }
 60}