예제 #1
0
        public void GetHashCodeNonDefault()
        {
            var eTag = new ETag("a");

            Assert.AreEqual(eTag.GetHashCode(), new ETag("a").GetHashCode());
            Assert.AreNotEqual(eTag.GetHashCode(), new ETag("A").GetHashCode());
        }
예제 #2
0
        public override int GetHashCode()
        {
            int hash = 17;

            hash *= 23 + ETag.GetHashCode();
            hash *= 23 + FirstPage.GetHashCode();

            return(hash);
        }
예제 #3
0
        public override int GetHashCode()
        {
            int hash = 17;

            hash *= 23 + ETag.GetHashCode();
            hash *= 23 + Response.GetHashCode();
            //hash *= 23 + Expired.GetHashCode();

            return(hash);
        }
예제 #4
0
 public override int GetHashCode()
 {
     unchecked
     {
         int hashCode = (ETag != null ? ETag.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (RequestPath != null ? RequestPath.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (RequestQueryString != null ? RequestQueryString.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (RequestMethod != null ? RequestMethod.GetHashCode() : 0);
         return(hashCode);
     }
 }
예제 #5
0
 public override int GetHashCode()
 {
     unchecked
     {
         int hashCode = (WeatherReading != null ? WeatherReading.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ RunTime.GetHashCode();
         hashCode = (hashCode * 397) ^ LastUpdated.GetHashCode();
         hashCode = (hashCode * 397) ^ (ETag != null ? ETag.GetHashCode() : 0);
         return(hashCode);
     }
 }
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (ETag != null ? ETag.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ MaxAge.GetHashCode();
         hashCode = (hashCode * 397) ^ Expires.GetHashCode();
         hashCode = (hashCode * 397) ^ LastModified.GetHashCode();
         hashCode = (hashCode * 397) ^ CacheControl.GetHashCode();
         return(hashCode);
     }
 }
예제 #7
0
        public override int GetHashCode()
        {
            int hash = 17;

            if (Id != null)
            {
                hash = hash * 31 + Id.GetHashCode();
            }
            if (Name != null)
            {
                hash = hash * 31 + Name.GetHashCode();
            }
            if (ETag != null)
            {
                hash = hash * 31 + ETag.GetHashCode();
            }
            return(hash);
        }
예제 #8
0
        public void GetHashCodeDefault()
        {
            var eTag = new ETag();

            Assert.AreEqual(eTag.GetHashCode(), new ETag(null).GetHashCode());
        }
예제 #9
0
 public override int GetHashCode() =>
 ETag.GetHashCode() ^
 LastModified.GetHashCode();
예제 #10
0
 public override int GetHashCode()
 => IfMatch.GetHashCode() ^ IfNoneMatch.GetHashCode();
예제 #11
0
        public override int GetHashCode()
        {
            var hashCode =
                Created.GetHashCode() ^
                LastModified.GetHashCode() ^
                Size.GetHashCode() ^
                IsFavorite.GetHashCode() ^
                CommentsCount.GetHashCode() ^
                CommentsUnread.GetHashCode() ^
                ShareTypes.GetHashCode() ^
                HasPreview.GetHashCode();

            if (ContentType != null)
            {
                hashCode ^= ContentType.GetHashCode();
            }

            if (Name != null)
            {
                hashCode ^= Name.GetHashCode();
            }

            if (Path != null)
            {
                hashCode ^= Path.GetHashCode();
            }

            if (CommentsHref != null)
            {
                hashCode ^= CommentsHref.GetHashCode();
            }

            // Is null on directories
            if (ETag != null)
            {
                hashCode ^= ETag.GetHashCode();
            }

            if (!string.IsNullOrEmpty(Id))
            {
                hashCode ^= Id.GetHashCode();
            }

            if (!string.IsNullOrEmpty(FileId))
            {
                hashCode ^= FileId.GetHashCode();
            }

            if (!string.IsNullOrEmpty(OwnderId))
            {
                hashCode ^= OwnderId.GetHashCode();
            }

            if (!string.IsNullOrEmpty(OwnerDisplayName))
            {
                hashCode ^= OwnerDisplayName.GetHashCode();
            }

            if (!string.IsNullOrEmpty(Checksums))
            {
                hashCode ^= Checksums.GetHashCode();
            }

            return(hashCode);
        }