From 5835379ec30b1667c4e522db9d294c9b7bb8633a Mon Sep 17 00:00:00 2001
From: buli <137736985@qq.com>
Date: 星期二, 26 四月 2022 12:00:31 +0800
Subject: [PATCH] SSBG Back up
---
force-app/main/default/classes/OrderPdfControllerTest.cls | 19 ++++++++++++++++++-
1 files changed, 18 insertions(+), 1 deletions(-)
diff --git a/force-app/main/default/classes/OrderPdfControllerTest.cls b/force-app/main/default/classes/OrderPdfControllerTest.cls
index b88b5f7..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,6 +122,7 @@
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,
@@ -136,6 +143,7 @@
insert oiList;
+ Test.startTest();
PageReference page = new PageReference('/apex/OrderContract?id=' + order.Id);
System.Test.setCurrentPage(page);
OrderPdfController controller = new OrderPdfController();
@@ -145,6 +153,7 @@
controller.saveBtn();
controller.printBtn();
+ Test.stopTest();
}
@isTest static void test_init2() {
@@ -280,6 +289,7 @@
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,
@@ -300,6 +310,7 @@
insert oiList;
+ Test.startTest();
PageReference page = new PageReference('/apex/OrderPdf?id=' + order.Id);
System.Test.setCurrentPage(page);
OrderPdfController controller = new OrderPdfController();
@@ -307,6 +318,7 @@
//controller.init();
controller.init2();
//controller.init();
+ Test.stopTest();
}
@isTest static void test_init2_2() {
@@ -429,6 +441,7 @@
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,
@@ -448,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'];
@@ -571,6 +585,7 @@
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,
@@ -591,6 +606,7 @@
insert oiList;
+ Test.startTest();
PageReference page = new PageReference('/apex/OrderContract?id=' + order.Id);
System.Test.setCurrentPage(page);
OrderPdfController controller = new OrderPdfController();
@@ -600,6 +616,7 @@
controller.saveBtn();
controller.printBtn();
+ Test.stopTest();
}
}
\ No newline at end of file
--
Gitblit v1.9.1