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

                }

            }
        }
Exemplo n.º 2
0
        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;
        }
Exemplo n.º 3
0
 public void user_inherits_from_entity()
 {
     var u = new User();
     Assert.IsTrue(u is Entity);
 }
Exemplo n.º 4
0
 public void add_list_with_unique_name_for_this_user_addsAList()
 {
     var u = new User();
     var list = new List { Name = "My new list" };
 }