< Summary

Class:Variables.RealmsInfo.CurrentRealmModel
Assembly:BaseVariable
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/DataStore/Variables/RealmsInfo/CurrentRealmVariable.cs
Covered lines:9
Uncovered lines:2
Coverable lines:11
Total lines:56
Line coverage:81.8% (9 of 11)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
CurrentRealmModel()0%110100%
Equals(...)0%220100%
Equals(...)0%330100%
Equals(...)0%3.333066.67%
Clone()0%110100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/DataStore/Variables/RealmsInfo/CurrentRealmVariable.cs

#LineLine coverage
 1using System;
 2
 3namespace Variables.RealmsInfo
 4{
 5    public class CurrentRealmVariable : BaseVariable<CurrentRealmModel>
 6    {
 7        public override bool Equals(CurrentRealmModel other)
 8        {
 9            if (value == null)
 10            {
 11                return other == null;
 12            }
 13
 14            return value.Equals(other);
 15        }
 16    }
 17
 18    [Serializable]
 19    public class CurrentRealmModel
 20    {
 21        public string layer;
 22        public string serverName;
 623        public string domain = string.Empty;
 624        public string contentServerUrl = string.Empty;
 25
 026        public bool isArchipelagoRealm => string.IsNullOrEmpty(layer);
 27
 28        public bool Equals(CurrentRealmModel other)
 29        {
 630            if (other == null)
 131                return false;
 532            return Equals(other.serverName, other.layer, other.domain, other.contentServerUrl);
 33        }
 34
 535        public bool Equals(string serverName, string layer, string domain, string contentServerUrl) { return Equals(serv
 36
 37        public bool Equals(string serverName, string layer)
 38        {
 539            if (isArchipelagoRealm)
 040                return this.serverName == serverName;
 41            else
 542                return this.serverName == serverName && this.layer == layer;
 43        }
 44
 45        public CurrentRealmModel Clone()
 46        {
 447            return new CurrentRealmModel()
 48            {
 49                serverName = serverName,
 50                layer = layer,
 51                domain = domain,
 52                contentServerUrl = contentServerUrl
 53            };
 54        }
 55    }
 56}