From 2d5b6ced9bbcb7a30159fd892b39d27a7e048b82 Mon Sep 17 00:00:00 2001
From: Li Jun <buli@deloitte.com.cn>
Date: 星期日, 24 四月 2022 09:41:45 +0800
Subject: [PATCH] BatchForAgencyContact

---
 force-app/main/default/classes/ConsumTrialPDFControllerTest.cls |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/force-app/main/default/classes/ConsumTrialPDFControllerTest.cls b/force-app/main/default/classes/ConsumTrialPDFControllerTest.cls
index f4f232d..0e8c407 100644
--- a/force-app/main/default/classes/ConsumTrialPDFControllerTest.cls
+++ b/force-app/main/default/classes/ConsumTrialPDFControllerTest.cls
@@ -2,6 +2,14 @@
 private class ConsumTrialPDFControllerTest {
     @testSetup
     static void setupTestData() {
+        
+        List<String> strList = new List<String>();
+        strList.add('Consum_Apply_Equipment_Set_Detail__c');
+        strList.add('Consum_Apply__c');
+        strList.add('Document');
+        strList.add('Agency_Contact__c');
+        TestDataUtility.CreatePIPolicyConfigurations(strList);
+        
         // 鐢ㄦ埛
         User testUser1 = new User(Test_staff__c = true);
         testUser1.LastName = 'TestLastName';
@@ -241,10 +249,15 @@
             System.assertEquals(1, testAppList.size());
             Consum_Apply__c testAppObj = testAppList[0];
             PageReference ref =  new PageReference('/apex/ConsumTrialPDF?Id=' + testAppObj.Id);
+            ref.getParameters().put('id',testAppObj.Id);
             Test.setCurrentPage(ref);
             ConsumTrialPDFController ctp = new ConsumTrialPDFController();
 
             Test.startTest();
+            ctp.init();
+            ref.getParameters().put('id','');
+            ctp.init();
+            ref.getParameters().put('id','dokmqfqqvdqawhdsa');
             ctp.init();
             Test.stopTest();
 
@@ -261,7 +274,7 @@
             // 鍙戣揣鍦板潃
             System.assertEquals('鍖椾含甯�', ctp.shippmentAddress);
             // 鎵�鏈塒DF椤甸泦鍚�
-            System.assertEquals(1, ctp.pdfPageList.size());
+            System.assertEquals(3, ctp.pdfPageList.size());
             ConsumTrialPDFController.PdfPageClass testPdfPage = ctp.pdfPageList[0];
             Consum_Apply_Equipment_Set_Detail__c testDetail1 = testPdfPage.equipSetDetailList[0];
             System.assertEquals('No02', testDetail1.Fixture_Model_No_F__c);  // 鏄庣粏鍨嬪彿

--
Gitblit v1.9.1