Example #1
0
        public void GetHashCodeTests()
        {
            Color c1 = new Color(0x00, 0x10, 0x20);
            Assert.AreEqual(c1.PackedValue, (uint)c1.GetHashCode(), "HashCode should match PackedValue");
            Assert.AreEqual(0xFF001020, (uint)c1.GetHashCode(), "Unexpected hash code");
            Assert.AreEqual(0xFF001020, c1.PackedValue, "Unexpected packedvalue");

            c1 = Color.Blue;
            Assert.AreEqual(c1.PackedValue, (uint)c1.GetHashCode(), "Color.Blue packedvalue and GetHashCode do not match");
        }