From eeb7c0a2d6f037d515bb822d739036b69c4dc73a Mon Sep 17 00:00:00 2001
From: 沙世明 <shashiming@prec-tech.com>
Date: 星期五, 08 四月 2022 17:14:12 +0800
Subject: [PATCH] Merge branch 'master' of http://47.92.229.245:8089/r/OlyMEBG

---
 force-app/main/default/classes/CampaignMemberServiceControllerTest.cls |   19 ++++++++++++-------
 1 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/force-app/main/default/classes/CampaignMemberServiceControllerTest.cls b/force-app/main/default/classes/CampaignMemberServiceControllerTest.cls
index b307839..3a62947 100644
--- a/force-app/main/default/classes/CampaignMemberServiceControllerTest.cls
+++ b/force-app/main/default/classes/CampaignMemberServiceControllerTest.cls
@@ -1,7 +1,11 @@
 @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];
 
@@ -28,7 +32,7 @@
         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';
@@ -111,11 +115,11 @@
 
 
         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);
@@ -148,6 +152,7 @@
     }
 
     @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'
@@ -166,10 +171,10 @@
 
 
         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 = '閿�鍞帹骞�';

--
Gitblit v1.9.1