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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
@isTest
private class OppSubmitControllerTest {
    
    @isTest
    static void  testMethod1() {
        Profile p = [select id from Profile where id =:System.Label.ProfileId_SystemAdmin];
        User u3 = new User(Test_staff__c = true);
        u3.LastName = '_サンブリッジ';
        u3.Batch_User__c = true;
        u3.FirstName = 'う';
        u3.Alias = 'う';
        u3.Email = 'olympusTest03@sunbridge.com';
        u3.Username = 'olympusTest03@sunbridge.com';
        u3.CommunityNickname = 'う';
        u3.IsActive = true;
        u3.EmailEncodingKey = 'ISO-2022-JP';
        u3.TimeZoneSidKey = 'Asia/Tokyo';
        u3.LocaleSidKey = 'ja_JP';
        u3.LanguageLocaleKey = 'ja';
        u3.ProfileId = p.id;
        u3.Job_Category__c = '支援';
        insert u3;
        System.runAs(u3){
            // 记录类型
            RecordType recHanbaiten = [select id from RecordType where IsActive = true and SobjectType= 'Account' and Name='販売店' limit 1];
            Account sellerA = new Account(Name = '販売店');
            sellerA.RecordTypeId = recHanbaiten.id;
            sellerA.Ban_On_Use_Date__c = Date.today().addDays(20);
            insert sellerA;
            // 授权申请
            Request_tedner_doc__c rtd = new Request_tedner_doc__c();
            rtd.Request_target__c = u3.Id;
            rtd.Bid_distributor__c = sellerA.Id;
            rtd.Tender_No__c = '12345';
            rtd.Tender_request_reason__c = 'reason';
            rtd.Product_discription__c = 'aa';
            insert rtd;
 
            OppSubmitController.initSubmitButton(rtd.Id);
            OppSubmitController.submit(rtd.Id);
            OppSubmitController.submitCancel(rtd.Id);
            OppSubmitController.submitCancel(rtd.Id+'1');
            OppSubmitController.UserInfo_Owner();
        }
    }
    // @IsTest
    // static void myTest1() {
        
    //     List<Request_tedner_doc__c> AccindoList = [Select Id, FROM Request_tedner_doc__c Where Assume_Change__c = true Limit 1];
 
    //     Test.StartTest();
    //     Database.executeBatch( new OppSubmitController(AccindoList),1);
    //     Test.stopTest();
    // }
}