예제 #1
0
 public User Add(User user)
 {
     return AddOrUpdate<User>("mm_Users_Create", new {
         Forename = user.Forename,
         Surname = user.Surname,
         Email = user.Email,
         Password = user.Password
     });
 }
예제 #2
0
        public User Update(User user)
        {
            if (user.UserID != _userId)
                return null;

            return AddOrUpdate<User>("mm_Users_Update", new {
                UserID = user.UserID,
                Forename = user.Forename,
                Surname = user.Surname,
                Email = user.Email,
                Password = user.Password,
                PasswordResetGUID = user.PasswordResetGUID,
                PasswordResetExpiry = user.PasswordResetExpiry
            });
        }
        public void Data_Create_User()
        {
            var repository = new UserRepository(_dataConnectionString, 1);

            var user = new MABMoney.Domain.User
            {
                Forename = "ADDEDFORENAME",
                Surname = "ADDEDSURNAME",
                Email = "*****@*****.**",
                Password = "******" // "password"
            };

            var result = repository.Add(user);

            Assert.IsTrue(result.UserID == 3);
            Assert.IsTrue(result.Forename == "ADDEDFORENAME");
            Assert.IsTrue(result.Surname == "ADDEDSURNAME");
            Assert.IsTrue(result.Email == "*****@*****.**");
            Assert.IsTrue(result.Password == "AEVg+8Chm8T0NSff0k0qegArPYXetlQfvKEoaDXwnT0N9fj0TVAjorveDX9vfbcVwA==");
            Assert.IsTrue(result.CreatedDate.Date == DateTime.Now.Date);
        }