Exemplo 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());
 }
Exemplo n.º 2
0
 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;
     }
 }
Exemplo 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);
 }