高章伟
2022-02-18 8b5f4c6c281cfa548f92de52c8021e37aa81901e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
@isTest
private class AssetMaintainDetailHandlerTest {
    static testMethod void testMethod1() {
        AssetMaintainHeader__c header = new AssetMaintainHeader__c();
        header.MaintainType__c = '冻结';
        header.Date__c = System.today();
        insert header;
 
        AssetMaintainDetail__c amd = new AssetMaintainDetail__c();
        amd.OrderNumber__c = 1;
        amd.AssetMaintainHeader__c = header.Id;
        amd.MaintainType__c = '冻结';
        insert amd;
 
        amd = [SELECT Name FROM AssetMaintainDetail__c LIMIT 1];
        System.assertEquals('WHD-DJ' + System.now().format('-YYYYMM-') + '0001', amd.Name);
 
    }
}