buli
2022-05-13 2f4492ee18f90274582fcc2bb06f5e9bf64136e8
force-app/main/default/classes/OrderPdfControllerTest.cls
@@ -1,12 +1,6 @@
@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'];
@@ -122,7 +116,6 @@
            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,
@@ -143,7 +136,6 @@
        insert oiList;
        Test.startTest();
        PageReference page = new PageReference('/apex/OrderContract?id=' + order.Id);
        System.Test.setCurrentPage(page);
        OrderPdfController controller = new OrderPdfController();
@@ -153,7 +145,6 @@
        controller.saveBtn();
        controller.printBtn();
        Test.stopTest();
    }
    @isTest static void test_init2() {
@@ -289,7 +280,6 @@
            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,
@@ -310,7 +300,6 @@
        insert oiList;
        Test.startTest();
        PageReference page = new PageReference('/apex/OrderPdf?id=' + order.Id);
        System.Test.setCurrentPage(page);
        OrderPdfController controller = new OrderPdfController();
@@ -318,7 +307,6 @@
        //controller.init();
        controller.init2();
        //controller.init();
        Test.stopTest();
    }
    @isTest static void test_init2_2() {
@@ -441,7 +429,6 @@
            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,
@@ -461,13 +448,12 @@
        }
        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'];
@@ -585,7 +571,6 @@
            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,
@@ -606,7 +591,6 @@
        insert oiList;
        Test.startTest();
        PageReference page = new PageReference('/apex/OrderContract?id=' + order.Id);
        System.Test.setCurrentPage(page);
        OrderPdfController controller = new OrderPdfController();
@@ -616,7 +600,6 @@
        controller.saveBtn();
        controller.printBtn();
        Test.stopTest();
    }
}