Exemplo n.º 1
0
        public void DifferentObjectGetHashCodeTest()
        {
            var firstObject = new CompositeKey <UserTypeA, UserTypeB>(new UserTypeA {
                UserId = 1, UserName = "******"
            }, new UserTypeB {
                Level = "123456", FriendlyUserTypeA = new UserTypeA {
                    UserId = 3, UserName = "******"
                }
            });
            var secondObject = new CompositeKey <UserTypeA, UserTypeB>(new UserTypeA {
                UserId = 2, UserName = "******"
            }, new UserTypeB {
                Level = "12345", FriendlyUserTypeA = new UserTypeA {
                    UserId = 4, UserName = "******"
                }
            });

            Assert.That(firstObject.GetHashCode() != secondObject.GetHashCode());
        }