コード例 #1
0
        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);
        }
コード例 #2
0
        public ActionResult Index()
        {
            _solicitacaoCreditoService.Solicitar
            (
                new RegistroSolicitacaoCreditoCommand
            {
                ClienteId = Guid.NewGuid(),
                Valor     = 0
            }
            );

            if (!_solicitacaoCreditoService.IsValid)
            {
                ViewBag.message = _solicitacaoCreditoService.StringifyNotifications();
            }

            return(View());
        }