From 4420517bbbffea48cabe7a7dcdf2e1c4b440fc85 Mon Sep 17 00:00:00 2001
From: GWY <guweiyi@prec-tech.com>
Date: 星期一, 30 五月 2022 16:15:26 +0800
Subject: [PATCH] 两个LS特殊条件在说明的增减
---
force-app/main/default/classes/OrderPdfControllerTest.cls | 31 ++++++++++++++++++++++++++-----
1 files changed, 26 insertions(+), 5 deletions(-)
diff --git a/force-app/main/default/classes/OrderPdfControllerTest.cls b/force-app/main/default/classes/OrderPdfControllerTest.cls
index fccaee2..0bf5f71 100644
--- a/force-app/main/default/classes/OrderPdfControllerTest.cls
+++ b/force-app/main/default/classes/OrderPdfControllerTest.cls
@@ -1,6 +1,12 @@
@isTest
private class OrderPdfControllerTest {
+ @TestSetup
+ static void setup(){
+ TestDataUtility.CreatePIPolicyConfigurations(new string[]{'Opportunity','Contact','Order','Document'});
+ }
+
+
@isTest static void test_init() {
List<RecordType> rectDealer = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = 'Dealer'];
List<RecordType> rectIE = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = 'Customer IE'];
@@ -116,9 +122,11 @@
SpecialDeliveryContact2_D__c = contact.Id,
OpportunityId = opp.Id,
EffectiveDate = Date.today(),
+ ProductListApproveStatus__c = 'Draft',RecordTypeId=rectOdr[0].Id,
Status = 'Draft',
Pricebook2Id = pricebook.Id,
- EndUser__c = contact.Id
+ EndUser__c = contact.Id,
+ EndUserD__c = contact.Id
);
insert order;
@@ -135,6 +143,7 @@
insert oiList;
+ Test.startTest();
PageReference page = new PageReference('/apex/OrderContract?id=' + order.Id);
System.Test.setCurrentPage(page);
OrderPdfController controller = new OrderPdfController();
@@ -144,6 +153,7 @@
controller.saveBtn();
controller.printBtn();
+ Test.stopTest();
}
@isTest static void test_init2() {
@@ -279,9 +289,11 @@
SpecialDeliveryContact2_D__c = contact.Id,
OpportunityId = opp.Id,
EffectiveDate = Date.today(),
+ ProductListApproveStatus__c = 'Draft',RecordTypeId=rectOdr[0].Id,
Status = 'Draft',
Pricebook2Id = pricebook.Id,
- EndUser__c = contact.Id
+ EndUser__c = contact.Id,
+ EndUserD__c = contact.Id
);
insert order;
@@ -298,6 +310,7 @@
insert oiList;
+ Test.startTest();
PageReference page = new PageReference('/apex/OrderPdf?id=' + order.Id);
System.Test.setCurrentPage(page);
OrderPdfController controller = new OrderPdfController();
@@ -305,6 +318,7 @@
//controller.init();
controller.init2();
//controller.init();
+ Test.stopTest();
}
@isTest static void test_init2_2() {
@@ -427,9 +441,11 @@
SpecialDeliveryContact2_D__c = contact.Id,
OpportunityId = opp.Id,
EffectiveDate = Date.today(),
+ ProductListApproveStatus__c = 'Draft',RecordTypeId=rectOdr[0].Id,
Status = 'Draft',
Pricebook2Id = pricebook.Id,
- EndUser__c = contact.Id
+ EndUser__c = contact.Id,
+ EndUserD__c = contact.Id
);
insert order;
@@ -445,12 +461,13 @@
}
insert oiList;
-
+ Test.startTest();
PageReference page = new PageReference('/apex/OrderPdf?id=' + order.Id);
System.Test.setCurrentPage(page);
OrderPdfController controller = new OrderPdfController();
controller.init2();
+ Test.stopTest();
}
@isTest static void test_init2_3() {
List<RecordType> rectDealer = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = 'Dealer'];
@@ -568,9 +585,11 @@
SpecialDeliveryContact2_D__c = contact.Id,
OpportunityId = opp.Id,
EffectiveDate = Date.today(),
+ ProductListApproveStatus__c = 'Draft',RecordTypeId=rectOdr[0].Id,
Status = 'Draft',
Pricebook2Id = pricebook.Id,
- EndUser__c = contact.Id
+ EndUser__c = contact.Id,
+ EndUserD__c = contact.Id
);
insert order;
@@ -587,6 +606,7 @@
insert oiList;
+ Test.startTest();
PageReference page = new PageReference('/apex/OrderContract?id=' + order.Id);
System.Test.setCurrentPage(page);
OrderPdfController controller = new OrderPdfController();
@@ -596,6 +616,7 @@
controller.saveBtn();
controller.printBtn();
+ Test.stopTest();
}
}
\ No newline at end of file
--
Gitblit v1.9.1