public void Should_Resolve_Correct_Dependencies() { //using (var uow = LocalIocManager.ResolveAsDisposable<IUnitOfWork>()) //{ // var appService = LocalIocManager.IocContainer.Resolve<IWechatRepayService>(); // var dto = new GetPayInfoDto // { // IdPerson = 22, // SystemCode = "222", // Channel = "333" // }; // var info = appService.GetPayInfoAsync(dto); // uow.Object.Complete(); // info.Success.ShouldBeTrue(); //} var appService = LocalIocManager.IocContainer.Resolve <IWechatRepayService>(); var dto = new GetPayInfoDto { IdPerson = 22, SystemCode = "222", Channel = "333" }; var info = appService.GetPayInfoAsync(dto); info.Success.ShouldBeTrue(); }
/// <summary> /// /// </summary> /// <param name="payInfo"></param> /// <returns></returns> public Result <PayInfoDto> GetPayInfoAsync(GetPayInfoDto payInfo) { var result = _wechatRepayDomainService.GetPayInfo(payInfo); if (!result.Success) { //todo: send email? } return(result); }
public Result <PayInfoDto> GetPayInfo(GetPayInfoDto payInfoDto) { var personId = payInfoDto.IdPerson; //todo: set the static constanct string creditChannel = string.IsNullOrWhiteSpace(payInfoDto.Channel) ? "Constant" : payInfoDto.Channel.ToUpper(); var autoCheckoffQuery = _checkoffAutoAcpRepository.GetAll().Where(a => a.IdPerson == personId && (a.PayStatus == "u" || (a.PayStatus == "k" && a.CommandType == 3))); var isWithholding = _checkoffCommandRepository.GetAll().Any(a => a.ProType == "c") || autoCheckoffQuery.Any(a => a.ProType == "c"); //todo: return the correct result var dto = new PayInfoDto(); return(Result.FromData(dto)); }
public async void Should_Resolve_Service_Correct() { var wechatService = LocalIocManager.IocContainer.Resolve <IWechatRepayService>(); var dto = new GetPayInfoDto { IdPerson = 1, SystemCode = "22", Channel = "33" }; var result = wechatService.GetPayInfoAsync(dto); result.Success.ShouldBeTrue(); var count = await wechatService.GetTodayAutoCheckoffTotalAsync(); count.Data.ShouldBeGreaterThanOrEqualTo(0); }
public Result <PayInfoDto> Repay(GetPayInfoDto payInfo) { return(_wechatRepayService.GetPayInfoAsync(payInfo)); }