Example #1
0
        public void ReturnsFalseWhenTheObjectIsNull()
        {
            var target = new Luid(0, 0);
            var result = target.Equals(null);

            Assert.False(result);
        }
Example #2
0
        public void ReturnsTrueWhenTheValuesAreEqualWhenTargetIsBoxed()
        {
            var    target1 = new Luid(1, 1);
            object target2 = new Luid(1, 1);

            var result = target1.Equals(target2);

            Assert.True(result);
        }
Example #3
0
        public void EqualsTestWithBoxedLuidObject()
        {
            bool expected = true;

            Luid target = new Luid(1, 1);
            Luid other  = new Luid(1, 1);

            bool actual = target.Equals((object)other);

            Assert.AreEqual(expected, actual);
        }
Example #4
0
        public void EqualsTestWithNullObject()
        {
            bool expected = false;

            Luid   target = new Luid(1, 1);
            object obj    = null;

            bool actual = target.Equals(obj);

            Assert.AreEqual(expected, actual);
        }
Example #5
0
        public void EqualsTest()
        {
            bool expected = false;

            Luid target = new Luid(1, 1);
            Luid other  = new Luid(2, 2);

            bool actual = target.Equals(other);

            Assert.AreEqual(expected, actual);
        }
Example #6
0
        public void EqualsTestWithBoxedLuidObject()
        {
            var expected = true;

            var target = new Luid(1, 1);
            var other  = new Luid(1, 1);

            var actual = target.Equals((object)other);

            Assert.AreEqual(expected, actual);
        }
Example #7
0
        public void EqualsTest()
        {
            var expected = false;

            var target = new Luid(1, 1);
            var other  = new Luid(2, 2);

            var actual = target.Equals(other);

            Assert.AreEqual(expected, actual);
        }
Example #8
0
        /// <summary>Returns a value indicating whether this <see cref="ModeInfo"/> structure equals another structure of the same type.</summary>
        /// <param name="other">A <see cref="ModeInfo"/> structure.</param>
        /// <returns>Returns true if this <see cref="ModeInfo"/> structure equals the <paramref name="other"/> structure, otherwise returns false.</returns>
        public bool Equals(ModeInfo other)
        {
            if ((InfoType != other.InfoType) || (Id != other.Id) || !AdapterId.Equals(other.AdapterId))
            {
                return(false);
            }

            if (InfoType == ModeInfoType.Source)
            {
                return(sourceMode.Equals(other.sourceMode));
            }

            if (InfoType == ModeInfoType.Target)
            {
                return(targetMode.Equals(other.targetMode));
            }

            return(true);
        }
Example #9
0
        public void EqualsTestWithBoxedLuidObject()
        {
            bool expected = true;

            Luid target = new Luid(1, 1);
            Luid other = new Luid(1, 1);

            bool actual = target.Equals((object)other);

            Assert.AreEqual(expected, actual);
        }
Example #10
0
        public void EqualsTestWithNullObject()
        {
            bool expected = false;

            Luid target = new Luid(1, 1);
            object obj = null;

            bool actual = target.Equals(obj);
            Assert.AreEqual(expected, actual);
        }
Example #11
0
        public void EqualsTest()
        {
            bool expected = false;

            Luid target = new Luid(1, 1);
            Luid other = new Luid(2, 2);

            bool actual = target.Equals(other);

            Assert.AreEqual(expected, actual);
        }