|  |  | 
 |  |  | @isTest | 
 |  |  | public with sharing class BmeWorkControllerTest { | 
 |  |  |    //----------------------------------------------------------------------------------------------------------- | 
 |  |  |    @TestSetup static void init() { | 
 |  |  |    @TestSetup  | 
 |  |  |     static void setUp(){ | 
 |  |  |         TestDataUtility.CreatePIPolicyConfigurations( new string[]{'Contact','Document'}); | 
 |  |  |     } | 
 |  |  |     static void init() { | 
 |  |  |       //insert p | 
 |  |  |       Profile p = [select Id from Profile where id = :System.Label.ProfileId_SystemAdmin]; | 
 |  |  |       //insert comOwner | 
 |  |  | 
 |  |  |       cam.Mailflg_before15__c = true; | 
 |  |  |       cam.Mailflg_before7__c = true; | 
 |  |  |       cam.Mailflg_after3__c = true; | 
 |  |  |       cam.HostName__c = 'HostName__c'; | 
 |  |  |       cam.cooperatorCompany__c = 'cooperatorCompany__c'; | 
 |  |  |  | 
 |  |  |       insert cam; | 
 |  |  |       //insert Contact | 
 |  |  |       Contact core = new Contact( | 
 |  |  | 
 |  |  |    } | 
 |  |  |    //---------------------------------------------------------------------------------------------------------------------- | 
 |  |  |    static testMethod void save() { | 
 |  |  |       Test.setMock(HttpCalloutMock.class, new TestDataUtility.CreatePIHelperHttpMock()); | 
 |  |  |       init(); | 
 |  |  |       PageReference page = new PageReference('/apex/BmeWork'); | 
 |  |  |       System.Test.setCurrentPage(page); | 
 |  |  |       BmeWorkController controller = new BmeWorkController(); | 
 |  |  |       controller.init(); | 
 |  |  |       controller.searchOppInner(); | 
 |  |  |       controller.oppRecords[0].changeFlg = '1'; | 
 |  |  |       controller.saveType = '1'; | 
 |  |  |       controller.save(); | 
 |  |  |       controller.saveType = '2'; | 
 |  |  |       controller.save(); | 
 |  |  |    } | 
 |  |  |    //---------------------------------------------------------------------------------------------------------------------- | 
 |  |  | 
 |  |  |       controller.oppCount = 1000; | 
 |  |  |       controller.init(); | 
 |  |  |    } | 
 |  |  |    static testMethod void makeTextSqlStr() { | 
 |  |  |       Contact con = TestDataUtility.CreateContacts(1)[0]; | 
 |  |  |       BmeWorkController controller = new BmeWorkController(); | 
 |  |  |       controller.numtextA = 'test'; | 
 |  |  |       controller.numtextA1 = 'Name'; | 
 |  |  |       controller.numtextB = 'testa\\s+ \\s+testb'; | 
 |  |  |       controller.numtextB1 = 'Name'; | 
 |  |  |       controller.numtextA2 = '<>'; | 
 |  |  |       controller.numtextB2 = '<>'; | 
 |  |  |       controller.searchOppInner(); | 
 |  |  |       controller.numtextA2 = '='; | 
 |  |  |       controller.numtextB2 = '='; | 
 |  |  |       controller.searchOppInner(); | 
 |  |  |       controller.numtextA2 = 'contains'; | 
 |  |  |       controller.numtextB2 = 'contains'; | 
 |  |  |       controller.searchOppInner(); | 
 |  |  |       controller.numtextA2 = 'notcontains'; | 
 |  |  |       controller.numtextB2 = 'notcontains'; | 
 |  |  |       controller.searchOppInner(); | 
 |  |  |  | 
 |  |  |       controller.numtextB2 = 'starts with'; | 
 |  |  |       controller.searchOppInner(); | 
 |  |  | 		 | 
 |  |  |    } | 
 |  |  | } |