< Summary

Class:AvatarModel
Assembly:AvatarModel
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Models/AvatarModel/AvatarModel.cs
Covered lines:19
Uncovered lines:0
Coverable lines:19
Total lines:56
Line coverage:100% (19 of 19)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
AvatarModel()0%110100%
Equals(...)0%10100100%
CopyFrom(...)0%220100%
GetDataFromJSON(...)0%110100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Models/AvatarModel/AvatarModel.cs

#LineLine coverage
 1using DCL.Helpers;
 2using System.Collections.Generic;
 3using System.Linq;
 4using UnityEngine;
 5
 6[System.Serializable]
 7public class AvatarModel : BaseModel
 8{
 9    public string id;
 10    public string name;
 11    public string bodyShape;
 12    public Color skinColor;
 13    public Color hairColor;
 14    public Color eyeColor;
 90115    public List<string> wearables = new List<string>();
 16    public string expressionTriggerId = null;
 90117    public long expressionTriggerTimestamp = -1;
 18    public string stickerTriggerId = null;
 90119    public long stickerTriggerTimestamp = -1;
 20    public bool talking = false;
 21
 22    public bool Equals(AvatarModel other)
 23    {
 7524        bool wearablesAreEqual = wearables.All(other.wearables.Contains) && wearables.Count == other.wearables.Count;
 25
 7526        return id == other.id &&
 27               name == other.name &&
 28               bodyShape == other.bodyShape &&
 29               skinColor == other.skinColor &&
 30               hairColor == other.hairColor &&
 31               eyeColor == other.eyeColor &&
 32               expressionTriggerId == other.expressionTriggerId &&
 33               expressionTriggerTimestamp == other.expressionTriggerTimestamp &&
 34               stickerTriggerTimestamp == other.stickerTriggerTimestamp &&
 35               wearablesAreEqual;
 36    }
 37
 38    public void CopyFrom(AvatarModel other)
 39    {
 24940        if (other == null)
 9841            return;
 42
 15143        name = other.name;
 15144        bodyShape = other.bodyShape;
 15145        skinColor = other.skinColor;
 15146        hairColor = other.hairColor;
 15147        eyeColor = other.eyeColor;
 15148        expressionTriggerId = other.expressionTriggerId;
 15149        expressionTriggerTimestamp = other.expressionTriggerTimestamp;
 15150        stickerTriggerId = other.stickerTriggerId;
 15151        stickerTriggerTimestamp = other.stickerTriggerTimestamp;
 15152        wearables = new List<string>(other.wearables);
 15153    }
 54
 155    public override BaseModel GetDataFromJSON(string json) { return Utils.SafeFromJson<AvatarModel>(json); }
 56}