高章伟
2022-02-24 2aa8da8af66aa8ae00f25831aed6bb0364176e7b
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
//create by rentx 2020-12-16
@isTest
private class searchHospitalControllerTest {
    static testMethod void testMethod1() {
        //建一个医院
        Account hospital = new Account();
        hospital.recordtypeId = [Select Id FROM RecordType WHERE IsActive = true and SobjectType = 'Account' and DeveloperName = 'HP'].id;
        hospital.Name = 'test hospital';
        hospital.Is_Active__c = '有効';
        hospital.Attribute_Type__c = '卫生部';
        hospital.Speciality_Type__c = '综合医院';
        hospital.Grade__c = '一级';
        hospital.OCM_Category__c = 'SLTV';
        hospital.Is_Medical__c = '医疗机构';
        // hospital.State_Master__c = al.id;
        // hospital.City_Master__c = al2.id;
        hospital.Town__c = '东京';
        insert hospital;
 
 
        
 
        //建一条医院特价产品
        hospitalprice__c hc = new hospitalprice__c();
        hc.hospital__c = hospital.Id;
        hc.aph__c = '12332';
        insert hc;
        PageReference page = new PageReference('/apex/searchHospital');
        page.setRedirect(true);
        System.Test.setCurrentPage(page);
        searchHospitalController conTest = new searchHospitalController();
        conTest.init();
        conTest.SearchName = 'test';
        conTest.serContact();
    }
}