You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							54 lines
						
					
					
						
							2.0 KiB
						
					
					
				
			
		
		
		
			
			
			
				
					
				
				
					
				
			
		
		
	
	
							54 lines
						
					
					
						
							2.0 KiB
						
					
					
				
								using Shentun.Peis.ChargeRequests;
							 | 
						|
								using Shentun.Peis.CustomerOrgs;
							 | 
						|
								using Shentun.Peis.Enums;
							 | 
						|
								using Shentun.Peis.LisRequests;
							 | 
						|
								using Shentun.Peis.Models;
							 | 
						|
								using Shentun.Peis.PatientRegisters;
							 | 
						|
								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 ChargeRequestAppServiceTest : PeisApplicationTestBase
							 | 
						|
								    {
							 | 
						|
								        private readonly IRepository<ChargeRequest, Guid> _repository;
							 | 
						|
								        private readonly ChargeRequestAppService _appService;
							 | 
						|
								        private readonly ITestOutputHelper _output;
							 | 
						|
								        private readonly IUnitOfWorkManager _unitOfWorkManager;
							 | 
						|
								        public ChargeRequestAppServiceTest(ITestOutputHelper testOutputHelper)
							 | 
						|
								        {
							 | 
						|
								            _output = testOutputHelper;
							 | 
						|
								            _unitOfWorkManager = GetRequiredService<IUnitOfWorkManager>();
							 | 
						|
								            _repository = GetRequiredService<IRepository<ChargeRequest, Guid>>();
							 | 
						|
								            _appService = GetRequiredService<ChargeRequestAppService>();
							 | 
						|
								        }
							 | 
						|
								
							 | 
						|
								        [Fact]
							 | 
						|
								        public async Task CreateAsync()
							 | 
						|
								        {
							 | 
						|
								            using (var unitOfWork = _unitOfWorkManager.Begin(isTransactional: true))
							 | 
						|
								            {
							 | 
						|
								
							 | 
						|
								                var entity = new CreateChargeRequestDto()
							 | 
						|
								                {
							 | 
						|
								                    PatientRegisterId = new Guid("3a123c55-06de-4988-691c-448b5af468ff"),
							 | 
						|
								                    RegisterCheckAsbitems = new List<CreateChargeRequestAsbitemDto>()
							 | 
						|
								                  {
							 | 
						|
								                      new CreateChargeRequestAsbitemDto() {RegisterCheckAsbitemId = new Guid("3a123c55-0792-17bd-6d63-d7b3238aca18")},
							 | 
						|
								                      new CreateChargeRequestAsbitemDto() {RegisterCheckAsbitemId = new Guid("3a123c55-0791-2d82-97be-1bf9a6152513")}
							 | 
						|
								                  }
							 | 
						|
								                };
							 | 
						|
								
							 | 
						|
								                var newEntity = await _appService.CreateAsync(entity);
							 | 
						|
								                //await unitOfWork.CompleteAsync();
							 | 
						|
								            }
							 | 
						|
								        }
							 | 
						|
								    }
							 | 
						|
								}
							 |