From 1312ba82d4c880bdb5357d28e0d4af5b285f610f Mon Sep 17 00:00:00 2001 From: 高章伟 <gaozhangwei@prec-tech.com> Date: 星期四, 10 三月 2022 15:54:39 +0800 Subject: [PATCH] 最近一月修改内容 --- force-app/main/default/classes/InquiryVerifyBatchTest.cls | 28 ++++++++++++++++++---------- 1 files changed, 18 insertions(+), 10 deletions(-) diff --git a/force-app/main/default/classes/InquiryVerifyBatchTest.cls b/force-app/main/default/classes/InquiryVerifyBatchTest.cls index 4568557..c3064d1 100644 --- a/force-app/main/default/classes/InquiryVerifyBatchTest.cls +++ b/force-app/main/default/classes/InquiryVerifyBatchTest.cls @@ -21,15 +21,14 @@ private static Date createdDateStr = Date.today(); static testMethod void testMethod1() { + System.Test.StartTest(); InitData(); - // System.Test.StartTest(); - // try { - ID exid = Database.executeBatch(new InquiryVerifyBatch(),1); - // System.abortJob(exid); - // } catch(Exception e){ - // } - // System.Test.StopTest(); + ID exid = Database.executeBatch(new InquiryVerifyBatch(),1); + InquiryVerifyBatch bct1 = new InquiryVerifyBatch(null,null); + System.schedule('Scheduled Job 5', '0 45 * * * ?', bct1); + + System.Test.StopTest(); } private static void InitData() { @@ -163,9 +162,11 @@ prd1.Category4__c = 'CV'; prd1.Category5__c = '260SL绯诲垪'; prd1.Asset_Model_No__c = '1001'; + prd1.Important_product__c = true; + prd1.Important_Rroduct_1GI__c = true; insert prd1; - + System.assertEquals(prd1.Important_product__c,true); PricebookEntry entry = new PricebookEntry(Pricebook2Id = pricebookId, Product2Id = prd1.Id); entry.UnitPrice = 0; @@ -173,7 +174,7 @@ entry.UseStandardPrice = false; entry.CurrencyIsoCode = 'CNY'; insert entry; - + System.assertEquals(prd1.Important_product__c,true); List<Quote> qList = [Select Id, CurrencyIsoCode from Quote where Id = : quote.Id]; System.assertEquals(1, qList.size()); System.assertEquals('CNY', qList[0].CurrencyIsoCode); @@ -189,7 +190,14 @@ target.Product2Id = prd1.id; target.PricebookEntryId = entry.Id; insert target; - + prd1.Important_product__c = true; + update prd1; + System.assertEquals(prd1.Important_product__c,true); + // System.assertEquals(target.Product2.Important_product__c,true); + system.assertEquals(target.Product2Id,prd1.id); + List<QuoteLineItem> qlts = [Select Id,Product2.Important_product__c,QuoteId from QuoteLineItem where id = :target.id]; + System.assertEquals(qlts[0].Product2.Important_product__c,true); + System.assertEquals(qlts[0].QuoteId,quote.id); Consumable_order_details2__c saledet1 = new Consumable_order_details2__c(); saledet1.Name = 'OCM_01_001001'; // saledet1.Consumable_order_minor__c = Order1.Id; -- Gitblit v1.9.1