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
@isTest
private class NFM512BatchTest {
 
    @IsTest
    static void TestMethod01() {
        String QLMrecordId = Schema.SObjectType.Tender_information__c.getRecordTypeInfosByDeveloperName().get('QLM').getRecordTypeId();
        
        Tender_information__c Ten = new Tender_information__c();
        Ten.Name = 'TenTest01';
        Ten.IsRelateProject__c = '是';
        Ten.RecordTypeId = QLMrecordId;
        // Ten.LastModifiedDate = Date.today();
 
        insert Ten;
 
        List<String> str = new List<String>();
        str.add(Ten.Id);
 
        Test.StartTest();
        Database.executeBatch( new NFM512Batch(Ten.Id),100);
        Database.executeBatch( new NFM512Batch(str),100);
        Database.executeBatch( new NFM512Batch(),100);
        Test.stopTest();
    }
 
    @IsTest
    static void TestMethod02() {
        String QLMrecordId = Schema.SObjectType.Tender_information__c.getRecordTypeInfosByDeveloperName().get('QLM').getRecordTypeId();
        
        Tender_information__c Ten = new Tender_information__c();
        Ten.Name = 'TenTest01';
        Ten.IsRelateProject__c = '是';
        Ten.RecordTypeId = QLMrecordId;
        // Ten.LastModifiedDate = Date.today();
 
        insert Ten;
 
        Date date1 = Date.today();
        Date date2 = Date.today().addDays(-1);
 
        Test.StartTest();
        Database.executeBatch( new NFM512Batch(date1),100);
        Database.executeBatch( new NFM512Batch(date2,date1),100);
        Test.stopTest();
    }
}