public void GetByName()
        {
            User user = new User
            {
                Name = "temp",
                Password = "******"
            };

            IUserRepository repo = ObjectFactory.GetInstance<IUserRepository>();
            User addedUser = repo.Add(user);
            User result = repo.GetByName(user.Name);

            Assert.AreEqual(result.Id, addedUser.Id);
        }
 public void Add()
 {
     User user = new User
     {
         Id = ObjectId.GenerateNewId().ToString(),
         Name = "moses",
         Password = "******",
         PasswordSalt = "mySalt",
         AccessToken = "myAccessToken"
     };
     IUserRepository repo = ObjectFactory.GetInstance<IUserRepository>();
     User result = repo.Add(user);
     Assert.AreEqual(result.Id, user.Id);
 }
        public static void InitUserData()
        {
            IUserRepository userRepository = ObjectFactory.GetInstance<IUserRepository>();

            User admin = userRepository.GetByName("effie");
            if (admin == null)
            {
                admin = new User
                {
                    Name = "effie",
                    Password = "******",
                    PasswordSalt = "mySalt",
                    AccessToken = "myAccessToken"
                };

                userRepository.Add(admin);
            }
        }
 public User Add(User user)
 {
     return m_userRepository.Add(user);
 }