| | |
| | | @isTest |
| | | private class CampaignMemberServiceControllerTest { |
| | | |
| | | @testSetup static void testSetupMethod() { |
| | | @testSetup |
| | | static void makeData(){ |
| | | TestDataUtility.CreatePIPolicyConfiguration('Contact'); |
| | | } |
| | | static void testSetupMethod() { |
| | | RecordType rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'Hp']; |
| | | List<RecordType> rectDpt = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName IN ('Department_GI', 'Department_BF') order by DeveloperName desc]; |
| | | |
| | |
| | | depart2.Department_Class__c = dept[1].Id; |
| | | depart2.Hospital__c = acc.Id; |
| | | insert new Account[] {depart1, depart2}; |
| | | Test.startTest(); |
| | | |
| | | Contact con = new Contact(); |
| | | con.LastName = 'lastname2'; |
| | | con.FirstName = 'firstname2'; |
| | |
| | | |
| | | |
| | | upsert cmList; |
| | | Test.stopTest(); |
| | | |
| | | |
| | | } |
| | | @isTest static void test_method_one() { |
| | | |
| | | testSetupMethod(); |
| | | list<Campaign> camlist = [select id from campaign]; |
| | | Campaign cam = camlist[0]; |
| | | PageReference page = new PageReference('/apex/CampaignMemberService?id=' + cam.Id); |
| | |
| | | } |
| | | |
| | | @isTest static void test_method_two() { |
| | | testSetupMethod(); |
| | | list<Campaign> camlist = [select id from campaign]; |
| | | Campaign cam1 = camlist[0]; |
| | | RecordType rectCA = [select Id from RecordType where IsActive = true and SobjectType = 'Campaign' |
| | |
| | | |
| | | |
| | | Contact con1 = new Contact(); |
| | | con1.LastName = 'testname2'; |
| | | con1.FirstName = 'firstname2'; |
| | | con1.LastName = 'testname2V2'; |
| | | con1.FirstName = 'firstname2V2'; |
| | | con1.Email = 'olympustest0331@sunbridge.com'; |
| | | con1.MobilePhone = '999999199'; |
| | | con1.MobilePhone = '999999199V2'; |
| | | con1.Work_Location_manual__c = 'location2'; |
| | | con1.Post_picklist__c = '部长'; |
| | | con1.Job_Category_picklist__c = '销售推广'; |