buli
2022-04-08 f1c525740c6a45b875d8ed96fb0ddb68c97ef3df
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
44
45
46
47
@isTest
public class TydelikeConControllerTest {
    static testMethod void testMethod1() {
        Account acctest = TestDataUtility.CreateAccounts(1)[0];
        acctest.ProductSegment__c = 'BS';
        update acctest;
        
        TydelikeContact__c tycotest = new TydelikeContact__c();
        tycotest.Name = 'test';
        tycotest.TyAddress__c = 'test';
        tycotest.TyFaxD__c = 'test';
        tycotest.TyPhoneD__c = '13566667777';
        tycotest.TyPostcode__c = '5000000';
        tycotest.EnglishAddress__c = 'test';
        tycotest.ContactEnglishName__c = 'test';
        insert tycotest;
        
        TydelikeAccount__c tyaccount = new TydelikeAccount__c();
 
        String url = ApexPages.currentPage().getParameters().put('accName',acctest.Name);
        url = ApexPages.currentPage().getParameters().put('tycoId',tycotest.Id);
        url = ApexPages.currentPage().getParameters().put('tyacId',tyaccount.Id);
        
        
        Test.startTest();
        TydelikeConController scc = new TydelikeConController();
        scc.acc = acctest;
        scc.tya = tyaccount;
        scc.init();
        scc.save();
        acctest.ProductSegment__c = 'IE';
        update acctest;
        scc.init();
        acctest.ProductSegment__c = 'NDT';
        update acctest;
        scc.init();
        acctest.ProductSegment__c = 'ANI';
        update acctest;
        scc.init();
        acctest.ProductSegment__c = 'RVI';
        update acctest;
        scc.init();
        Test.stopTest();
    }
   
        
}