|
|
using Shentun.Peis.Enums;using Shentun.Peis.Models;using Shentun.Peis.PatientRegisters;using Shentun.Peis.RegisterAsbitems;using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;using Volo.Abp.Domain.Repositories;using Volo.Abp.Uow;using Xunit;using Xunit.Abstractions;
namespace Shentun.Peis{ public class PatientRegisterAppServiceTest : PeisApplicationTestBase { private readonly IRepository<PatientRegister> _repository; private readonly PatientRegisterAppService _appService; private readonly ITestOutputHelper _output; private readonly IUnitOfWorkManager _unitOfWorkManager; public PatientRegisterAppServiceTest(ITestOutputHelper testOutputHelper) { _output = testOutputHelper; _unitOfWorkManager = GetRequiredService<IUnitOfWorkManager>(); _repository = GetRequiredService<IRepository<PatientRegister>>(); _appService = GetRequiredService<PatientRegisterAppService>(); } [Fact] public async Task CreatePatientRegisterAsync() { using (var unitOfWork = _unitOfWorkManager.Begin()) { var entity = new CreatePatientRegisterDto() { MedicalCenterId = new Guid("68f2d834-2bf0-4978-ad54-d2133c12a333"), PatientId = new Guid("3a119be6-d9aa-2e13-a764-0b363c60169d"), CustomerOrgId = new Guid("00000000-0000-0000-0000-000000000001"), CustomerOrgRegisterId = new Guid("00000000-0000-0000-0000-000000000002"), PatientName = "test", SexId = SexFlag.UnKnown, BirthDate = null, Age = 38, JobCardNo = "jobCardNo", MedicalCardNo = "MedicalCardNo", MaritalStatusId = MaritalStatusFlag.Married, MedicalTypeId = new Guid("3a0c5093-6dbf-d29b-cfbc-b1f742ee59d3"), PersonnelTypeId = new Guid("3a0c5099-a5f3-e41a-dfab-caeae79e0dfe"), JobPost = "JobPost", JobTitle = "JobTitle", Salesman = "Salesman", SexHormoneTermId = new Guid("3a0d38cf-8b3c-95db-1a69-5119f28dc468"), MedicalConclusionId = new Guid("3a0c50fe-cacf-d3c8-8c3c-9d3495d8bd76"), IsUpload = 'N', CompleteFlag = PatientRegisterCompleteFlag.PreRegistration, IsMedicalStart = 'N', MedicalStartDate = null, IsRecoverGuide = 'N', SummaryDate = null, IsAudit = 'N', IsLock = 'N', IsNameHide = 'N', IsPhoneFollow = 'N', IsVip = 'N', Remark = "Remark" }; entity.RegisterAsbitems.Add(new CreateRegisterCheckAsbitemDto() { AsbitemId = new Guid("3a0c55fa-63b9-1510-3e81-20750c496d44"), StandardPrice = 10, ChargePrice = 10, Amount = 1, PayTypeFlag = PayTypeFlag.PersonPay, IsCharge = 'N' }); entity.RegisterAsbitems.Add(new CreateRegisterCheckAsbitemDto() { AsbitemId = new Guid("3a0c5600-ae78-9ed4-e3c1-993ef41d3c51"), StandardPrice = 10, ChargePrice = 10, Amount = 1, PayTypeFlag = PayTypeFlag.PersonPay, IsCharge = 'N' });
entity.RegisterAsbitems.Add(new CreateRegisterCheckAsbitemDto() { AsbitemId = new Guid("3a0c5635-b904-dc9b-593e-93d0dd228576"), StandardPrice = 10, ChargePrice = 10, Amount = 1, PayTypeFlag = PayTypeFlag.PersonPay, IsCharge = 'N' });
entity.RegisterAsbitems.Add(new CreateRegisterCheckAsbitemDto() { AsbitemId = new Guid("3a11abbc-b19e-3549-e639-acc0e9aa6fbc"), StandardPrice = 10, ChargePrice = 10, Amount = 1, PayTypeFlag = PayTypeFlag.PersonPay, IsCharge = 'N' });
var newEntity = await _appService.CreatePatientRegisterAsync(entity); await unitOfWork.CompleteAsync(); } } }}
|