/// <inheritdoc/>
        public int GetHashCode(AttributeKey obj)
        {
            if (obj == null)
            {
                throw LogArgumentNullException(nameof(obj));
            }

            return(obj.GetHashCode());
        }
Esempio n. 2
0
        public void HashCode_Works()
        {
            var key = new AttributeKey();

            key.ReadFrom(Convert.FromBase64String("AC4AAAAAABcAAAAAABEAYwBvAG0ALgBhAHAAcABsAGUALgBkAGUAYwBtAHAAZgBz"), 0);

            var clone = new AttributeKey();

            clone.ReadFrom(Convert.FromBase64String("AC4AAAAAABcAAAAAABEAYwBvAG0ALgBhAHAAcABsAGUALgBkAGUAYwBtAHAAZgBz"), 0);

            var other = new AttributeKey();

            key.ReadFrom(Convert.FromBase64String("AC4AAAAAABcAAAAAABEAYwBvAG0ALgBhAHAAcABsAGUALgBkAGUAYwBtAHAAZgBz"), 0);

            Assert.Equal(key.GetHashCode(), key.GetHashCode());
            Assert.Equal(key.GetHashCode(), clone.GetHashCode());
            Assert.NotEqual(other.GetHashCode(), key.GetHashCode());
        }
Esempio n. 3
0
 public override int GetHashCode()
 {
     return(AttributeKey.GetHashCode());
 }
 public int GetHashCode(AttributeKey obj)
 {
     return(obj.GetHashCode());
 }