public void UniqueEmailAttribute_IsValid_Passing_Duplicate_Email_Returns_False() { using (var session = _store.OpenSession()) { session.Store(FakeObjects.TestUser()); session.SaveChanges(); } bool result; using (var session = _store.OpenSession()) { var uniqueEmailAttribute = new UniqueEmailAttribute() { DocumentSession = session }; result = uniqueEmailAttribute.IsValid(FakeValues.Email); } Assert.IsFalse(result); }
public void UniqueEmailAttribute_IsValid_Passing_Unique_Email_Returns_True() { using (var session = _store.OpenSession()) { session.Store(FakeObjects.TestUser()); session.SaveChanges(); } bool result; using (var session = _store.OpenSession()) { var uniqueEmailAttribute = new UniqueEmailAttribute() { DocumentSession = session }; result = uniqueEmailAttribute.IsValid("*****@*****.**"); } Assert.IsTrue(result); }
public void IsValid_ForExistingEmail_ReturnsFalse() { Assert.AreEqual(false, uniqueEmailAttribute.IsValid("*****@*****.**")); }