public void Will_be_able_to_save_and_retrieve_an_account_dto() { var accountDto = new AccountReport(Guid.NewGuid(), Guid.NewGuid(), "Account Name", "1234567890"); _repository.Save(accountDto); var sut = _repository.GetByExample<AccountReport>(new { AccountName = "Account Name" }).FirstOrDefault(); Assert.That(sut.Id, Is.EqualTo(accountDto.Id)); Assert.That(sut.ClientDetailsReportId, Is.EqualTo(accountDto.ClientDetailsReportId)); Assert.That(sut.AccountName, Is.EqualTo(accountDto.AccountName)); Assert.That(sut.AccountNumber, Is.EqualTo(accountDto.AccountNumber)); }
public virtual ActionResult Save(AccountReport account) { try { if (ModelState.IsValid) { PublishAndCommit(new ChangeAccountNameCommand(account.Id, account.AccountName)); return RedirectToAction(MVC.Account.Details.Show(account.Id)); } } catch (Exception ex) { ReportError(ex.Message); } return View(Views.Show, account); }