using Shentun.WebPeis.AppointPatientRegisters; using Shentun.WebPeis.AppointRegisterAsbitems; using Shentun.WebPeis.Enums; using Shentun.WebPeis.Models; using Shentun.WebPeis.Persons; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Volo.Abp.Domain.Repositories; using Volo.Abp.Modularity; using Volo.Abp.Uow; using Xunit; using Xunit.Abstractions; namespace Shentun.WebPeis { public class AppointPatientRegisterAppServiceTest : WebPeisApplicationTestBase where TStartupModule : IAbpModule { private readonly IRepository _repository; private readonly AppointPatientRegisterAppService _appService; private readonly ITestOutputHelper _output; private readonly IUnitOfWorkManager _unitOfWorkManager; public AppointPatientRegisterAppServiceTest(ITestOutputHelper output) { _unitOfWorkManager = GetRequiredService(); _repository = GetRequiredService>(); _appService = GetRequiredService(); _output = output; } [Fact] public async Task CreateAsync() { using (var unitOfWork = _unitOfWorkManager.Begin(isTransactional: true)) { var entity = new CreateAppointPatientRegisterDto() { PersonId = new Guid("3a12d7fa-63f1-d549-c2f8-01123e5b7a8a"), CustomerOrgGroupId = null, CustomerOrgId = GuidFlag.PersonCustomerOrgId, MedicalCenterId = new Guid("150da355-dfbf-466b-9697-355836a862c4"), MedicalPackageId = null, MedicalStartDate = DateTime.Now, CustomerOrgRegisterId = GuidFlag.PersonCustomerOrgRegisterId, PregnantFlag = PregnantFlag.None, Height = 170, Weight = 60 }; entity.Asbitems.Add( new CreateAppointRegisterAsbitemDto() { AsbitemId = new Guid("3a126b34-f6f0-56a1-e899-a092874acde7"), Amount = 1, ChargePrice = (decimal)30.5 } ); var newEntity = await _appService.CreateAsync(entity); await unitOfWork.CompleteAsync(); } } } }