コード例 #1
0
 public User(UserEdit.Command message)
 {
     Name     = message.Name;
     Email    = message.Email;
     Password = message.Password;
     Profile  = message.Profile;
 }
コード例 #2
0
        public void Should_save()
        {
            // arrange
            var command = new UserEdit.Command
            {
                Name            = "John Lennon",
                Email           = "*****@*****.**",
                Password        = "******",
                ConfirmPassword = "******",
                Profile         = Profile.Admin
            };

            // act
            Send(command);

            // assert
            WithDb(db =>
            {
                var user = db.Users.Single();
                user.Name.ShouldBe(command.Name);
                user.Email.ShouldBe(command.Email);
                user.Password.ShouldBe(command.Password);
                user.Profile.ShouldBe(command.Profile);
            });
        }
コード例 #3
0
 public ActionResult Save(UserEdit.Command command)
 {
     _mediator.Send(command);
     return(this.RedirectToActionJson(c => c.Index()));
 }