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
@isTest
private class lexAccountControllerTest {
    @TestSetup
    static void makeData(){
        List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院'];
        if (rectCo.size() == 0) {
            return;
        }
        // テストデータ
        Account company = new Account();
        company.RecordTypeId = rectCo[0].Id;
        company.Name         = 'TestCompany';
        upsert company;
    }
    static testMethod void test1(){
        Account company = [select Id from Account limit 1];
        Test.startTest();
        lexAccountController.init(company.Id);
        lexAccountController.initForNewSolutonProButton(company.Id);
        lexAccountController.initForOTHCreateButton(company.Id);
        lexAccountController.initForRepairContact(company.Id);
 
        lexAccountController.initForDepartmentCreate(company.Id,'BF');
        lexAccountController.initForDepartmentCreate(company.Id,'ENT');
        lexAccountController.initForDepartmentCreate(company.Id,'GI');
        lexAccountController.initForDepartmentCreate(company.Id,'GS');
        lexAccountController.initForDepartmentCreate(company.Id,'GYN');
        lexAccountController.initForDepartmentCreate(company.Id,'OTH');
        lexAccountController.initForDepartmentCreate(company.Id,'URO');
        lexAccountController.initForDepartmentCreate('','');
        Test.stopTest();
    }
}