Beispiel #1
0
        public void UseCaseInsensitveComparisonForGetHashCode()
        {
            var userStatus1 = new TestEnum("Foo");
            var userStatus2 = TestEnum.Foo;

            userStatus1.GetHashCode().Should().Be(userStatus2.GetHashCode());
        }
Beispiel #2
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (SubArray != null ? SubArray.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (IntArray != null ? IntArray.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (IntIntArray != null ? IntIntArray.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Poco != null ? Poco.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (String != null ? String.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Dictionary != null ? Dictionary.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Delegate != null ? Delegate.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (TestEnum != null ? TestEnum.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Exception != null ? Exception.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (ImmutableList != null ? ImmutableList.GetHashCode() : 0);
         return(hashCode);
     }
 }
Beispiel #3
0
 public override int GetHashCode()
 {
     return(337929216 + testEnum.GetHashCode());
 }