方式1、 [TestMethod] public async Task CreateRule_Test() { var svc = base.Resolve<IInsuranceRuleService>(); await Task.Run(async () => { var rs = await svc.Create(new InsuranceRuleViewModel { ExpressAccountID = 23, RuleType = InsuranceFeeRuleType.Sku, Weights = 100 }); Console.WriteLine(rs); }); }
方式2、[TestMethod] public void GetInsuranceRuleList_Test() { var svc = base.Resolve<IInsuranceRuleService>(); var rs = svc.GetInsuranceRuleList(new QueryInsuranceRuleViewModel { SearchType = ExpressCooperationType.Supplier, KeyWord = "", PageIndex = 1, PageSize = 10 }).GetAwaiter().GetResult(); }