Esempio n. 1
0
 public void ShouldKnowUsersWithNullFieldsHaveEqualHashCodes()
 {
     var user = new BirdBrainMembershipUser("test", null, "*****@*****.**", "", "", true, false, DateTime.MinValue, DateTime.MinValue, DateTime.MinValue, DateTime.MinValue, DateTime.MinValue);
     var otherUser = new BirdBrainMembershipUser("othertest", "1", null, "", "", true, false, DateTime.MinValue, DateTime.MinValue, DateTime.MinValue, DateTime.MinValue, DateTime.MinValue);
     Assert.AreNotEqual(user, otherUser);
     Assert.AreEqual(user.GetHashCode(), otherUser.GetHashCode());
 }
 protected bool Equals(BirdBrainMembershipUser other)
 {
     try
     {
         return(ProviderUserKey.Equals(other.ProviderUserKey) && UserName.Equals(other.UserName) &&
                Email.Equals(other.Email));
     }
     catch (NullReferenceException)
     {
         return(false);
     }
 }
 protected bool Equals(BirdBrainMembershipUser other)
 {
     try
     {
         return ProviderUserKey.Equals(other.ProviderUserKey) && UserName.Equals(other.UserName) &&
                Email.Equals(other.Email);
     }
     catch (NullReferenceException)
     {
         return false;
     }
 }
Esempio n. 4
0
 public void ShouldKnowDifferentUsersMayNotBeEqual()
 {
     var user = new BirdBrainMembershipUser("test", "1", "*****@*****.**", "", "", true, false, DateTime.MinValue, DateTime.MinValue, DateTime.MinValue, DateTime.MinValue, DateTime.MinValue);
     var otherUser = new BirdBrainMembershipUser("othertest", "1", "*****@*****.**", "", "", true, false, DateTime.MinValue, DateTime.MinValue, DateTime.MinValue, DateTime.MinValue, DateTime.MinValue);
     Assert.AreNotEqual(user, otherUser);
 }