public void CreateUser_WithMandatoryParameters_Calls_CreateUserCommand_Once()
        {
            _createUserCommand.Setup(s => s.Execute(createUserModel)).ReturnsAsync(1);

            Task <int> result = _createUser.Execute(createUserModel);

            _createUserCommand.Verify(v => v.Execute(createUserModel), Times.Once);
        }
Exemplo n.º 2
0
        public void CreateUser_WithoutFirstName_NeverCalls_CreateUserCommand()
        {
            createUserModel.FirstName = string.Empty;

            Task <int> result = _createUser.Execute(createUserModel);

            _createUserCommand.Verify(v => v.Execute(createUserModel), Times.Never);
        }
Exemplo n.º 3
0
 public async Task CreateUser(string nome, string login, string email, int roleId)
 {
     await createUser.Execute(nome, login, email, roleId);
 }
 public async Task <Guid> Post([FromBody] UserCreateModel user)
 {
     return(await _createUser.Execute(user.To()));
 }
Exemplo n.º 5
0
 public async Task <Domain.Entities.Usuario> CreateUser(string nome, string login, string email, int roleId)
 {
     return(await createUser.Execute(nome, login, email, roleId));
 }