private async Task AddDepartment_WithValidDepartment_ShouldInvokeRepository_Async() { Department valid = new Department("Name"); await _service.AddDepartmentAsync(valid); _repositoryMock.Verify(x => x.AddAsync(valid), Times.Once); }
public async Task <object> AddDepartmentAsync([FromBody] DepartmentAddModel model) { GeneralResponse response = await departmentService.AddDepartmentAsync(model); if (response.IsSuccess) { return(Ok()); } return(BadRequest(response.Message)); }