public void can_persist_and_query_documents() { using (var store = new EmbeddableDocumentStore { RunInMemory = true, DataDirectory = "RavenData" } ) { store.Initialize(); using (var session = store.OpenSession()) { var user = new User { Email = "*****@*****.**", FirstName = "Micky", LastName = "Bubbles", }; session.Store(user); session.SaveChanges(); Assert.AreEqual(true, session.Query<User>().Where(x => x.Email == "*****@*****.**").Any()); } } }
public UpdatePasswordResult UpdatePassword(User user, string newPassword) { if (newPassword.Length < 5) { return UpdatePasswordResult.notLongEnough; } var salt = GenerateSalt(); var newHash = _passwordHasher.ComputeHash(newPassword, salt); user.HashedPassword = newHash; return UpdatePasswordResult.successful; }
public void user_inherits_from_entity() { var u = new User(); Assert.IsTrue(u is Entity); }
public void add_list_with_unique_name_for_this_user_addsAList() { var u = new User(); var list = new List { Name = "My new list" }; }