From 3ba0123db48f8bab81ddf0913e1b95280ef545e8 Mon Sep 17 00:00:00 2001
From: Li Jun <buli@deloitte.com.cn>
Date: 星期四, 31 三月 2022 17:56:53 +0800
Subject: [PATCH] Deploy0331

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

diff --git a/force-app/main/default/classes/ConsumTrialPDFControllerTest.cls b/force-app/main/default/classes/ConsumTrialPDFControllerTest.cls
index f4f232d..d883890 100644
--- a/force-app/main/default/classes/ConsumTrialPDFControllerTest.cls
+++ b/force-app/main/default/classes/ConsumTrialPDFControllerTest.cls
@@ -2,6 +2,13 @@
 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');
+        TestDataUtility.CreatePIPolicyConfigurations(strList);
+        
         // 鐢ㄦ埛
         User testUser1 = new User(Test_staff__c = true);
         testUser1.LastName = 'TestLastName';
@@ -241,10 +248,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 +273,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