高章伟
2022-02-18 8b5f4c6c281cfa548f92de52c8021e37aa81901e
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
48
49
50
51
52
53
54
55
56
57
@isTest
private class CreateSolEditControllerTest {
    private static User getUser() {
        String timenow = Datetime.now().format('yyyyMMddHHmmss');
        User user1 = new User(Test_staff__c = true, LastName = 'TestMao', FirstName = 'TestMaoF',
                Alias = 'hp', CommunityNickname = 'TestMao', Email = 'Test@sunbridge.com',
                Username = 'Test' + timenow + '@sunbridge.com', IsActive = true, EmailEncodingKey = 'ISO-2022-JP',
                TimeZoneSidKey = 'Asia/Tokyo', LocaleSidKey = 'ja_JP', LanguageLocaleKey = 'ja',
                ProfileId = System.Label.ProfileId_SystemAdmin,
                Dept__c = '医疗华北营业本部', Job_Category__c = '销售服务', Province__c = '北京');
 
        List<Profile> p = [Select Id From Profile Where Name = '2S1_销售医院担当'];
        System.assertEquals(p.size(), 1);
        System.runAs(new User(Id = Userinfo.getUserId())) {
            insert user1;
        }
        return user1;
    }
 
    static testMethod void testMethod1() {
        User user = getUser();
        SolutionProjectRequirements__c solProject = new SolutionProjectRequirements__c();
        solProject.Name = 'Test';
        solProject.HospitalOwner__c = user.Id;
        solProject.Sales_Assistant__c = user.Id;
        solProject.GIR_Assistant__c = user.Id;
        solProject.Project_Type__c = '新建大楼';
        solProject.Purpose_Proposal__c = '促进销售商谈';
        insert solProject;
        Solution_Programme__c solProgramme1 =  new Solution_Programme__c();
        solProgramme1.Name = 'test';
        solProgramme1.SolutionProjectRequirements__c = solProject.Id;
        solProgramme1.Business_Promotion__c = user.id;
        insert solProgramme1;
        CreateSolEditController createSolEdit = new CreateSolEditController(new ApexPages.StandardController(solProgramme1));
        createSolEdit.checkRecordTypeEDIT();
 
        // solProgramme1.Proposal_Date__c = Date.today();
        // solProgramme1.ProcessOfApproval__c = true;
        // solProgramme1.Confirmation_Result__c = '01采纳/部分采纳';
        // solProgramme1.Remarks__c = '01';
        // update solProgramme1;
        // solProgramme1.Confirmation_Result__c = '02未采纳';
        // solProgramme1.ProcessOfApproval__c = true;
        // solProgramme1.Remarks__c = '02';
        // update solProgramme1;
        // solProgramme1.Confirmation_Result__c = '03跟进中';
        // solProgramme1.ProcessOfApproval__c = true;
        // solProgramme1.Remarks__c = '03';
        // update solProgramme1;
        // solProgramme1.Confirmation_Result__c = '04其他';
        // solProgramme1.ProcessOfApproval__c = true;
        // solProgramme1.Remarks__c = '04';
        // update solProgramme1;
 
    }
}