Ejemplo n.º 1
0
        public void HashCodeNotEqualsTest()
        {
            var chatLink = new ItemChatLink {
                ItemId = 12, Quantity = 1, SkinId = 5, Upgrade1Id = 76, Upgrade2Id = 99
            };
            var chatLink2 = new ItemChatLink {
                ItemId = 12, Quantity = 2, SkinId = 5, Upgrade1Id = 76, Upgrade2Id = 99
            };
            var chatLink3 = new ItemChatLink {
                ItemId = 12, Quantity = 1, SkinId = 7, Upgrade1Id = 76, Upgrade2Id = 99
            };
            var chatLink4 = new ItemChatLink {
                ItemId = 12, Quantity = 1, SkinId = 5, Upgrade1Id = 99, Upgrade2Id = 99
            };
            var chatLink5 = new ItemChatLink {
                ItemId = 12, Quantity = 1, SkinId = 5, Upgrade1Id = 76, Upgrade2Id = 10
            };

            Assert.NotEqual(chatLink.GetHashCode(), chatLink2.GetHashCode());
            Assert.NotEqual(chatLink.GetHashCode(), chatLink3.GetHashCode());
            Assert.NotEqual(chatLink.GetHashCode(), chatLink4.GetHashCode());
            Assert.NotEqual(chatLink.GetHashCode(), chatLink5.GetHashCode());
            Assert.NotEqual(chatLink2.GetHashCode(), chatLink3.GetHashCode());
            Assert.NotEqual(chatLink2.GetHashCode(), chatLink4.GetHashCode());
            Assert.NotEqual(chatLink2.GetHashCode(), chatLink5.GetHashCode());
            Assert.NotEqual(chatLink3.GetHashCode(), chatLink4.GetHashCode());
            Assert.NotEqual(chatLink3.GetHashCode(), chatLink5.GetHashCode());
            Assert.NotEqual(chatLink4.GetHashCode(), chatLink5.GetHashCode());
        }
Ejemplo n.º 2
0
        public void HashCodeEqualsTest()
        {
            var chatLink = new ItemChatLink {
                ItemId = 12, Quantity = 1, SkinId = 5, Upgrade1Id = 76, Upgrade2Id = 99
            };
            var chatLink2 = new ItemChatLink {
                ItemId = 12, Quantity = 1, SkinId = 5, Upgrade1Id = 76, Upgrade2Id = 99
            };

            Assert.Equal(chatLink.GetHashCode(), chatLink2.GetHashCode());
        }