예제 #1
0
        public async Task Add_deve_adicionar_usuario()
        {
            //Arrange
            var usuarioViewModel = new UsuarioViewModel()
            {
                Email    = "*****@*****.**",
                Senha    = "1234",
                PessoaId = Guid.NewGuid()
            };

            //Act
            await _usuarioAppService.AddAsync(usuarioViewModel);

            //Assert
            _mocker.GetMock <IMediatorHandler>().Verify(dn =>
                                                        dn.PublishDomainNotification(It.IsAny <DomainNotification>()), Times.Never);
            _mocker.GetMock <IMediatorHandler>().Verify(v =>
                                                        v.SendCommand(It.IsAny <AddUsuarioCommand>()), Times.Once);
        }
예제 #2
0
        public async Task <IActionResult> Add([FromBody] UsuarioViewModel usuarioViewModel)
        {
            await _appService.AddAsync(usuarioViewModel);

            return(CustomResponse());
        }