@isTest
|
private class InvocableUtilTest {
|
|
static ConsumTestDataFactory factory;
|
@testSetup static void setupTestData(){
|
factory = new ConsumTestDataFactory();
|
factory.setupTestData();
|
factory.selectDetails(2);
|
}
|
|
@isTest
|
static void testMethond1() {
|
Consum_Apply__c ca = [SELECT Id FROM Consum_Apply__c LIMIT 1];
|
List<Consum_Apply_Equipment_Set_Detail__c> caesdList = [SELECT Id
|
FROM Consum_Apply_Equipment_Set_Detail__c
|
WHERE Consum_Apply__c =: ca.Id];
|
System.assertEquals(2, caesdList.size());
|
List<InvocableUtil.LoggingRequest> lList = new List<InvocableUtil.LoggingRequest>();
|
InvocableUtil.LoggingRequest l = new InvocableUtil.LoggingRequest();
|
l.objId = ca.Id;
|
lList.add(l);
|
InvocableUtil.createLog(lList);
|
caesdList = [SELECT Id
|
FROM Consum_Apply_Equipment_Set_Detail__c
|
WHERE Consum_Apply__c =: ca.Id];
|
System.assertEquals(0, caesdList.size());
|
}
|
}
|