public async Task<IActionResult> Post([FromBody] UserSkillCommand command) { //var id = _userSkillService.Create(inputModel); var id = await _mediator.Send(command); return CreatedAtAction(nameof(GetById), new { id = id }, command); }
public void UserSkill(UserInfo user, AbstractUserStateLogic logic, int skillId) { UserSkillCommand cmd = m_UserSkillCommandPool.Alloc(); if (null != cmd) { cmd.SetContext(user, logic); cmd.Init(skillId); user.GetAiStateInfo().CommandQueue.Enqueue(cmd); } }
public async Task InputDataIsOk_Executed_ReturnUserSkillId() { // Arrange var userSkillRepository = new Mock <IUserSkillRepository>(); var userSkillCommand = new UserSkillCommand { IdSkill = 1, IdUser = 1 }; var userSkillCommandHandler = new UserSkillCommandHandler(userSkillRepository.Object); // Act var id = await userSkillCommandHandler.Handle(userSkillCommand, new CancellationToken()); // Assert Assert.True(id >= 0); }