@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 = '断念找回(断念取消)'; try { insert amd; } catch (Exception e) {} //amd = [SELECT Name FROM AssetMaintainDetail__c LIMIT 1]; //System.assertEquals('WHD-DJ' + System.now().format('-YYYYMM-') + '0001', amd.Name); } }