黄千龙
2022-04-08 01f207d979d6be17c8cdec293feab48828c0ec3e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*
 * Author: Guo, Aline Yaying
 * Created Date: 03/22/2022
 * Purpose: Test Class
 * History: 
 *      03/22/2022 - Guo, Aline Yaying - Initial Code.
 * 
 * */
@isTest
private class NewAndEditAgencyContactControllerTest {
    @TestSetup
    static void makeData(){
        TestDataUtility.CreatePIPolicyConfiguration();
    }
    static testMethod void testMethod2() {
     
        
        Test.setMock(HttpCalloutMock.class, new TestDataUtility.CreateMetaDataUtilityHttpMock());
        Agency_Contact__c agenCon = TestDataUtility.CreateAgencyContacts(1)[0];
        Contact cont = TestDataUtility.CreateContacts(1)[0];
        agenCon.Contact__c = cont.Id;
        update agenCon; 
        Test.startTest();
        ApexPages.StandardController con =  new ApexPages.StandardController(agenCon);
        try{
            NewAndEditAgencyContactController agTest = new NewAndEditAgencyContactController(con);
            System.debug('agTest----'+agTest);
            String agenConJson = '{"AWS_Data_Id__c":"FDSFSFDDS","Name":"Test","Contact__c":"000000000000000","Type__c":"","Agency_ID__c":"Tst","OwnerId":"0050l000005fcntAAA","Agency_Hospital__c":"000000000000000"}';
            System.debug('ag JSON----'+agenConJson);
            //NewAndEditAgencyContactController.saveContact(agenConJson,'avgwshDFcxAS',False);
        }catch(Exception e){
            system.debug('Exception from save contact');
        }
        Test.stopTest();
    }
    
    static testMethod void testMethod2A() {
 
        String agenConJson = '{"AWS_Data_Id__c":"FDSFSFDDS","Name":"Test","Contact__c":"000000000000000","Type__c":"","Agency_ID__c":"Tst","OwnerId":"0050l000005fcntAAA","Agency_Hospital__c":"000000000000000"}';
            System.debug('ag JSON----'+agenConJson);
        NewAndEditAgencyContactController.saveContact(agenConJson,'avgwshDFcxAS',False);
    }
}