public async Task <VbWithPORequestViewModel> GetCreatedData() { var viewmodel = GetViewModel(); var model = GetVbRequestModelToCreate(); await _service.CreateAsync(model, viewmodel); return(await _service.ReadByIdAsync2(model.Id)); }
public async Task Should_Success_MapToViewModel() { var dbContext = GetDbContext(GetCurrentMethod()); var serviceProviderMock = GetServiceProviderMock(); var service = new VbWithPORequestService(dbContext, serviceProviderMock.Object); var dataUtil = new VbWithPORequestDataUtil(service); var data = await dataUtil.GetCreatedData(); var result = await service.ReadByIdAsync2(data.Id); Assert.NotNull(result); }