Exemplo n.º 1
0
        public void TestEquals_SameInstance()
        {
            var maxLong  = Int64.MaxValue;
            var instance = new BatchId(maxLong);

            Assert.IsTrue(instance.Equals(instance));
        }
Exemplo n.º 2
0
        public void TestEquals_NullObject()
        {
            var maxLong  = Int64.MaxValue;
            var instance = new BatchId(maxLong);

            Assert.IsFalse(instance.Equals(null));
        }
Exemplo n.º 3
0
        public void TestEquals_DifferentObjectType()
        {
            var maxLong  = Int64.MaxValue;
            var instance = new BatchId(maxLong);

            Assert.IsFalse(instance.Equals(1));
        }
Exemplo n.º 4
0
        /// <summary>
        /// Returns true if ExecProviderEvent instances are equal
        /// </summary>
        /// <param name="other">Instance of ExecProviderEvent to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(ExecProviderEvent other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     BatchId == other.BatchId ||
                     BatchId != null &&
                     BatchId.Equals(other.BatchId)
                     ) &&
                 (
                     ExeScript == other.ExeScript ||
                     ExeScript != null &&
                     ExeScript.Equals(other.ExeScript)
                 ) &&
                 (
                     EventType == other.EventType ||
                     EventType != null &&
                     EventType.Equals(other.EventType)
                 ) &&
                 (
                     ActivityId == other.ActivityId ||
                     ActivityId != null &&
                     ActivityId.Equals(other.ActivityId)
                 ));
        }
Exemplo n.º 5
0
        public void TestEquals_DifferentInstanceSameId()
        {
            var maxLong       = Int64.MaxValue;
            var instance      = new BatchId(maxLong);
            var otherInstance = new BatchId(maxLong);

            Assert.IsTrue(instance.Equals(otherInstance));
        }