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.
		
		
		
		
		
			
		
			
				
					
					
						
							124 lines
						
					
					
						
							3.8 KiB
						
					
					
				
			
		
		
		
			
			
			
				
					
				
				
					
				
			
		
		
	
	
							124 lines
						
					
					
						
							3.8 KiB
						
					
					
				
								using Shentun.Peis.ChargeRequests;
							 | 
						|
								using Shentun.Peis.ColumnReferences;
							 | 
						|
								using Shentun.Peis.Models;
							 | 
						|
								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 ColumnReferenceAppServiceTest : PeisApplicationTestBase
							 | 
						|
								    {
							 | 
						|
								        private readonly IRepository<ColumnReference, Guid> _repository;
							 | 
						|
								        private readonly ColumnReferenceAppService _appService;
							 | 
						|
								        private readonly ITestOutputHelper _output;
							 | 
						|
								        private readonly IUnitOfWorkManager _unitOfWorkManager;
							 | 
						|
								        public ColumnReferenceAppServiceTest(ITestOutputHelper testOutputHelper)
							 | 
						|
								        {
							 | 
						|
								            _output = testOutputHelper;
							 | 
						|
								            _unitOfWorkManager = GetRequiredService<IUnitOfWorkManager>();
							 | 
						|
								            _repository = GetRequiredService<IRepository<ColumnReference, Guid>>();
							 | 
						|
								            _appService = GetRequiredService<ColumnReferenceAppService>();
							 | 
						|
								        }
							 | 
						|
								
							 | 
						|
								        [Fact]
							 | 
						|
								        public async Task GetAppColumnNames()
							 | 
						|
								        {
							 | 
						|
								            using (var unitOfWork = _unitOfWorkManager.Begin(isTransactional: true))
							 | 
						|
								            {
							 | 
						|
								
							 | 
						|
								                var entity = new ColumnReferenceIdInputDto()
							 | 
						|
								                {
							 | 
						|
								                    Id = new Guid("3a1222e4-3249-34a2-85f0-f72e974de543"),
							 | 
						|
								
							 | 
						|
								                };
							 | 
						|
								
							 | 
						|
								                var newEntity = await _appService.GetAppColumnsAsync(entity);
							 | 
						|
								                if(newEntity != null)
							 | 
						|
								                {
							 | 
						|
								                    foreach(var column in newEntity)
							 | 
						|
								                    {
							 | 
						|
								                        _output.WriteLine(column.Name);
							 | 
						|
								                    }
							 | 
						|
								                }
							 | 
						|
								                await unitOfWork.CompleteAsync();
							 | 
						|
								            }
							 | 
						|
								        }
							 | 
						|
								
							 | 
						|
								        [Fact]
							 | 
						|
								        public async Task GetInterfaceColumnNames()
							 | 
						|
								        {
							 | 
						|
								            using (var unitOfWork = _unitOfWorkManager.Begin(isTransactional: true))
							 | 
						|
								            {
							 | 
						|
								
							 | 
						|
								                var entity = new ColumnReferenceIdInputDto()
							 | 
						|
								                {
							 | 
						|
								                    Id = new Guid("3a1222e4-3249-34a2-85f0-f72e974de543"),
							 | 
						|
								
							 | 
						|
								                };
							 | 
						|
								
							 | 
						|
								                var newEntity = await _appService.GetInterfaceColumnsAsync(entity);
							 | 
						|
								                if (newEntity != null)
							 | 
						|
								                {
							 | 
						|
								                    foreach (var column in newEntity)
							 | 
						|
								                    {
							 | 
						|
								                        _output.WriteLine(column.Name);
							 | 
						|
								                    }
							 | 
						|
								                }
							 | 
						|
								                await unitOfWork.CompleteAsync();
							 | 
						|
								            }
							 | 
						|
								        }
							 | 
						|
								
							 | 
						|
								        [Fact]
							 | 
						|
								        public async Task GetAppCodeValues()
							 | 
						|
								        {
							 | 
						|
								            using (var unitOfWork = _unitOfWorkManager.Begin(isTransactional: true))
							 | 
						|
								            {
							 | 
						|
								
							 | 
						|
								                var entity = new ColumnReferenceIdInputDto()
							 | 
						|
								                {
							 | 
						|
								                    Id = new Guid("3a1222e4-3249-34a2-85f0-f72e974de543"),
							 | 
						|
								
							 | 
						|
								                };
							 | 
						|
								
							 | 
						|
								                var newEntity = await _appService.GetAppCodeValuesAsync(entity);
							 | 
						|
								                foreach (var column in newEntity)
							 | 
						|
								                {
							 | 
						|
								                    _output.WriteLine(column.DisplayName);
							 | 
						|
								                }
							 | 
						|
								                await unitOfWork.CompleteAsync();
							 | 
						|
								            }
							 | 
						|
								        }
							 | 
						|
								
							 | 
						|
								        [Fact]
							 | 
						|
								        public async Task GetInterfaceCodeValues()
							 | 
						|
								        {
							 | 
						|
								            using (var unitOfWork = _unitOfWorkManager.Begin(isTransactional: true))
							 | 
						|
								            {
							 | 
						|
								
							 | 
						|
								                var entity = new ColumnReferenceIdInputDto()
							 | 
						|
								                {
							 | 
						|
								                    Id = new Guid("3a1222e4-3249-34a2-85f0-f72e974de543"),
							 | 
						|
								
							 | 
						|
								                };
							 | 
						|
								
							 | 
						|
								                var newEntity = await _appService.GetInterfaceCodeValuesAsync(entity);
							 | 
						|
								                if(newEntity != null)
							 | 
						|
								                {
							 | 
						|
								                    foreach (var column in newEntity)
							 | 
						|
								                    {
							 | 
						|
								                        _output.WriteLine(column.DisplayName);
							 | 
						|
								                    }
							 | 
						|
								                }
							 | 
						|
								              
							 | 
						|
								                await unitOfWork.CompleteAsync();
							 | 
						|
								            }
							 | 
						|
								        }
							 | 
						|
								    }
							 | 
						|
								}
							 |