示例#1
0
        public void Equality(Size2 size1, Size2 size2, bool expectedToBeEqual)
        {
            Assert.IsTrue(Equals(size1, size2) == expectedToBeEqual);
            Assert.IsTrue(size1 == size2 == expectedToBeEqual);
            Assert.IsFalse(size1 == size2 != expectedToBeEqual);
            Assert.IsTrue(size1.Equals(size2) == expectedToBeEqual);

            if (expectedToBeEqual)
            {
                Assert.AreEqual(size1.GetHashCode(), size2.GetHashCode());
            }
        }
示例#2
0
        public void HashCode(Size2 size1, Size2 size2, bool expectedThatHashCodesAreEqual)
        {
            var hashCode1 = size1.GetHashCode();
            var hashCode2 = size2.GetHashCode();

            if (expectedThatHashCodesAreEqual)
            {
                Assert.AreEqual(hashCode1, hashCode2);
            }
            else
            {
                Assert.AreNotEqual(hashCode1, hashCode2);
            }
        }