Пример #1
0
        public void ClienteTestSucesso()
        {
            var viewModelFake = ViewModelFaKe(Guid.NewGuid(), 1, 1);
            var cliente       = new Cliente(viewModelFake.Id, 0, 0, "alan", "guerra", "45645645678", "489456");

            _repository.Setup(x => x.ObterPorId(viewModelFake.Id)).Returns(cliente);

            _appService.Atualizar(viewModelFake);

            _repository.Verify(x => x.Atualizar(It.IsAny <Cliente>()), Times.Once());
        }
Пример #2
0
 public ActionResult Edit(ClienteViewModel clienteViewModel)
 {
     if (ModelState.IsValid)
     {
         _clienteAppService.Atualizar(clienteViewModel);
         return(RedirectToAction("Index"));
     }
     return(View(clienteViewModel));
 }