public User(UserEdit.Command message) { Name = message.Name; Email = message.Email; Password = message.Password; Profile = message.Profile; }
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); }); }
public ActionResult Save(UserEdit.Command command) { _mediator.Send(command); return(this.RedirectToActionJson(c => c.Index())); }