< Summary

Class:DCL.Social.Friends.FriendRequest
Assembly:FriendsController
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/FriendsController/FriendRequest.cs
Covered lines:17
Uncovered lines:4
Coverable lines:21
Total lines:44
Line coverage:80.9% (17 of 21)
Covered branches:0
Total branches:0
Covered methods:8
Total methods:12
Method coverage:66.6% (8 of 12)

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
Equals(...)0%550100%
Equals(...)0%5.264057.14%
GetHashCode()0%2100%
FriendRequest(...)0%110100%
IsSentTo(...)0%2100%
IsReceivedFrom(...)0%2100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/FriendsController/FriendRequest.cs

#LineLine coverage
 1using System;
 2using System.Collections.Generic;
 3
 4namespace DCL.Social.Friends
 5{
 6    public class FriendRequest
 7    {
 8        protected bool Equals(FriendRequest other) =>
 89            FriendRequestId == other.FriendRequestId && Timestamp == other.Timestamp && From == other.From && To == othe
 10
 11        public override bool Equals(object obj)
 12        {
 813            if (ReferenceEquals(null, obj)) return false;
 814            if (ReferenceEquals(this, obj)) return true;
 815            if (obj.GetType() != this.GetType()) return false;
 816            return Equals((FriendRequest)obj);
 17        }
 18
 19        public override int GetHashCode() =>
 020            HashCode.Combine(FriendRequestId, Timestamp, From, To, MessageBody);
 21
 7022        public string FriendRequestId { get; }
 7223        public DateTime Timestamp { get; }
 9024        public string From { get; }
 5525        public string To { get; }
 2926        public string MessageBody { get; }
 027        public bool HasBodyMessage => !string.IsNullOrEmpty(MessageBody);
 28
 5629        public FriendRequest(string friendRequestId, DateTime timestamp, string from, string to, string messageBody)
 30        {
 5631            FriendRequestId = friendRequestId;
 5632            Timestamp = timestamp;
 5633            From = from;
 5634            To = to;
 5635            MessageBody = messageBody;
 5636        }
 37
 38        public bool IsSentTo(string userId) =>
 039            To == userId;
 40
 41        public bool IsReceivedFrom(string userId) =>
 042            From == userId;
 43    }
 44}