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
@isTest
private class UpdateOppLastModifiedBatchTest {
 
    @IsTest
    static void TestMethod01() {
 
        StaticParameter.EscapeOppandStaTrigger = true;
 
        Tender_information__c TenInfo = new Tender_information__c();
        TenInfo.Name = 'Test20240117';
        insert TenInfo;
 
        Tender_information__History tenH = new Tender_information__History();
        tenH.Field = 'Bid_Winning_Date__c';
        tenH.ParentId = TenInfo.Id;
        insert tenH;
 
        Opportunity opp = new Opportunity();
        opp.Name = 'test询价';
        opp.StageName = '目標';
        opp.SAP_Send_OK__c = false;
        opp.CloseDate = Date.newInstance(2024, 7, 15);
        opp.Bidding_Project_Name_Bid__c = TenInfo.Id;
        insert opp;
 
        List<String> str = new List<String>();
        str.add(TenInfo.Id);
 
        Test.StartTest();
        Database.executeBatch( new UpdateOppLastModifiedBatch(),100);
        Database.executeBatch( new UpdateOppLastModifiedBatch(str),100);
        Test.stopTest();
 
        StaticParameter.EscapeOppandStaTrigger = false;
    }
 
}