public void TestMethod1() { var mock = new RepositoryMock(); var service = new SolicitacaoCreditoService(mock); service.Solicitar(new RegistroSolicitacaoCreditoCommand { ClienteId = Guid.NewGuid(), Valor = 0 }); Assert.IsFalse(service.IsValid); Assert.IsFalse(mock.Chamado); }
public ActionResult Index() { _solicitacaoCreditoService.Solicitar ( new RegistroSolicitacaoCreditoCommand { ClienteId = Guid.NewGuid(), Valor = 0 } ); if (!_solicitacaoCreditoService.IsValid) { ViewBag.message = _solicitacaoCreditoService.StringifyNotifications(); } return(View()); }