liuyn
2024-03-11 a87f1c3df03078814ee97ad0c8ac200a232419e9
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
@isTest
private class LexRequestCloseControllerTest {
    public static String rectCo = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('Agency').getRecordTypeId();
    public static String rectHp = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('HP').getRecordTypeId();
    public static String leadNR = Schema.SObjectType.Lead.getRecordTypeInfosByDeveloperName().get('NewDaily_Report').getRecordTypeId();
    public static String rectAg = Schema.SObjectType.Contact.getRecordTypeInfosByDeveloperName().get('Agency').getRecordTypeId();
    static testMethod void testMethod1() {
        Task t1 = new Task(
            Subject = 'test_task',
            Status = '未着手',
            Priority = '中'
        );
        insert new Task[] {t1};
 
        Account testRectcoAccounts = new Account(Name = 'testRectcoAccount', RecordTypeId =Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('HP').getRecordTypeId());
        insert testRectcoAccounts;
        Account testRectHpAccounts = new Account(Name = 'testRectHpAccount', RecordTypeId = rectCo, Hospital__c = testRectcoAccounts.id);
        insert testRectHpAccounts;
        Contact testContacts = new Contact(email='jplumber@salesforce.com', firstname='Joe', lastname='Plumber',RecordTypeId = rectAg,  AWS_Data_Id__c = 'TestContact', accountId = testRectHpAccounts.id);
        insert testContacts;
        Lead testLeads = new Lead(LastName='testLead', Company='testLead',RecordTypeId = leadNR, Hospital_Name__c = testRectHpAccounts.id, Contact_Name__c = testContacts.Id);
        insert testLeads;
        QuoteIrai__c irai = new QuoteIrai__c();
        irai.IraiSubject__c = '委托01';
        irai.IraiUser__c = null;
        irai.CurrencyIsoCode = 'USD';
        insert irai;
        LexRequestCloseController.init(null);
        LexRequestCloseController.getProfileId();
        LexRequestCloseController.getProfileIds();
        LexRequestCloseController.updateTask(t1.Id,'未着手');
        LexRequestCloseController.updateTask('asdsa','未着手');
    }
}