using Shentun.WebPeis.Models; using Shentun.WebPeis.Persons; using Shentun.WebPeis.Wechats; 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 abstract class PersonAppServiceTest : WebPeisApplicationTestBase where TStartupModule : IAbpModule { private readonly IRepository _repository; private readonly PersonAppService _appService; //private readonly ITestOutputHelper _output; private readonly IUnitOfWorkManager _unitOfWorkManager; public PersonAppServiceTest() { //ITestOutputHelper testOutputHelper //_output = testOutputHelper; _unitOfWorkManager = GetRequiredService(); _repository = GetRequiredService>(); _appService = GetRequiredService(); //_output = GetRequiredService(); } [Fact] public async Task GetWechatUserTokenAsync() { using (var unitOfWork = _unitOfWorkManager.Begin(isTransactional: true)) { var entity = new WechatUserJsCodeInputDto() { JsCode = "0c1yTa0w3mErQ23eot3w3ocsxw4yTa0P" }; var newEntity = await _appService.GetWechatUserTokenAsync(entity); await unitOfWork.CompleteAsync(); } } } }