public async void UpdateRemark_Should_Call_IRemarksRepository_UpdateRemark() { var remarkId = "remarkId"; var request = new UpdateRemarkRequest { Remark = "remarks" }; UpdatableRemarkDetails arg = null; await _repository.UpdateRemark(Arg.Any <string>(), Arg.Do <UpdatableRemarkDetails>(a => arg = a)); await _service.UpdateRemark(remarkId, request); await _repository.Received(1).UpdateRemark(remarkId, Arg.Any <UpdatableRemarkDetails>()); arg.Remark.Should().Be(request.Remark); }
public async Task <ActionResult <ApiResponse> > UpdateRemark(string remarkId, [FromBody] UpdateRemarkRequest updates, [FromServices] IRemarksService remarksService) { await remarksService.UpdateRemark(remarkId, updates); return(ApiResponseHelper.Ok("Remark updated.", remarkId)); }