高章伟
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
@isTest
public with sharing class EquipmentDraftOnceYearBatchTest {
    static testMethod void myUnitTest1() {
 
         //备品借出申请
        Rental_Apply__c raObj = new Rental_Apply__c();
        raObj.Name = 'testra';
        raObj.Status__c = '草案中';
        raObj.Product_category__c = 'GI';
        raObj.Demo_purpose1__c = '产品试用';
        raObj.direct_send__c = '医疗机构';
        raObj.Loaner_received_staff__c = '王五';
        raObj.Loaner_received_staff_phone__c = '110';
        raObj.direct_shippment_address__c = '北京市';
        raObj.Hope_Lonaer_date_Num__c = 1;  // 希望借用天数
        raObj.Phone_number__c = '1234567890';
        raObj.Follow_pcl_status2_Text__c = '引合 : -';
        raObj.demo_purpose2__c = '其他' ;
        insert raObj;
        System.Test.StartTest();
        Id execBTId1 = Database.executeBatch(new EquipmentDraftOnceYearBatch(raObj.id), 10);
        Database.executeBatch(new EquipmentDraftOnceYearBatch(), 10);
        EquipmentDraftOnceYearBatch.test();
        System.Test.StopTest();
    }
}