Example #1
0
        public ActionResult Register(UserRegisterViewModel user)
        {
            if (ModelState.IsValid)
            {
                userService.Create(user.ConvertToDomain());
                return View("Success");
            }

            return View();
        }
        public void ConvertToDomain()
        {
            var viewModel = new UserRegisterViewModel()
            {
                Login = "******",
                Email = "*****@*****.**",
                Password = "******",
                PasswordRepeated = "1234"
            };

            var user = viewModel.ConvertToDomain();

            user.Login.Should().Be(viewModel.Login);
            user.Email.Should().Be(viewModel.Email);
            user.Password.Should().Be("81DC9BDB52D04DC20036DBD8313ED055");
        }