using NPOI.SS.Formula.Functions; using Shentun.Pacs.CustomerOrgGroups; using Shentun.Pacs.CustomerOrgs; using Shentun.Pacs.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.Pacs { public class CustomerOrgGroupAppServiceTest : PeisApplicationTestBase { private readonly IRepository _repository; private readonly CustomerOrgGroupAppService _appService; private readonly ITestOutputHelper _output; private readonly IUnitOfWorkManager _unitOfWorkManager; public CustomerOrgGroupAppServiceTest(ITestOutputHelper testOutputHelper) { _output = testOutputHelper; _unitOfWorkManager = GetRequiredService(); _repository = GetRequiredService>(); _appService = GetRequiredService(); } [Fact] public async Task UpdateAsync() { var id = new Guid("3a0e6d96-4d37-af35-59cf-eb6f8d27c163"); var item = await _repository.GetAsync(id); var updateItem = new UpdateCustomerOrgGroupDto() { DisplayName = item.DisplayName, ForSexId = item.ForSexId, MaritalStatusId = item.MaritalStatusId, AgeLowerLimit = item.AgeLowerLimit, AgeUpperLimit = item.AgeUpperLimit, Price = 1000, }; await _appService.UpdateAsync(id, updateItem); } [Fact] public async Task GetListInCustomerOrgIdAsync() { using (IUnitOfWork unitOfWork = _unitOfWorkManager.Begin()) { var items = await _appService.GetListInCustomerOrgIdAsync(new Guid("3a0c5104-62b4-a00a-0e0c-51e558f42515")); foreach (var item in items) { _output.WriteLine(item.DisplayName); } await unitOfWork.CompleteAsync(); } } } }