Example #1
0
        public void Equality_DifferentVariant()
        {
            var a = new KaVEVersion(123, Variant.Development);
            var b = new KaVEVersion(123, Variant.Default);

            Assert.AreNotEqual(a, b);
            Assert.AreNotEqual(a.GetHashCode(), b.GetHashCode());
        }
Example #2
0
        public void Equality_ReallyTheSame()
        {
            var a = new KaVEVersion(123, Variant.Development);
            var b = new KaVEVersion(123, Variant.Development);

            Assert.AreEqual(a, b);
            Assert.AreEqual(a.GetHashCode(), b.GetHashCode());
        }
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = StartTime.GetHashCode();
         hashCode = (hashCode * 397) ^ Duration.GetHashCode();
         hashCode = (hashCode * 397) ^ UserId.GetHashCode();
         hashCode = (hashCode * 397) ^ IDESessionId.GetHashCode();
         hashCode = (hashCode * 397) ^ (KaVEVersion != null ? KaVEVersion.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ Project.GetHashCode();
         return(hashCode);
     }
 }
Example #4
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (Id != null ? Id.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (IDESessionUUID != null ? IDESessionUUID.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (KaVEVersion != null ? KaVEVersion.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ TriggeredAt.GetHashCode();
         hashCode = (hashCode * 397) ^ (int)TriggeredBy;
         hashCode = (hashCode * 397) ^ Duration.GetHashCode();
         hashCode = (hashCode * 397) ^ (ActiveWindow != null ? ActiveWindow.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (ActiveDocument != null ? ActiveDocument.GetHashCode() : 0);
         return(hashCode);
     }
 }