public class AccountTriggerCheckDisabled {
public static boolean IsHandlerDisabled(Schema.SObjectType classType, string customMetadataField) {
// Query the Disable_Triggers__mdt CMDT based on the params and return a boolean
return true;
}
}
public class AccountTriggerCheckDisabled {
// This would need to be keyed by the Schema.SObjectType as well.
// I'm only using the string to make this example quicker.
private Map<string, boolean> testResponse = new Map<string, boolean>();
@TestVisible
private static void defineTestResponse(Schema.SObjectType classType, string customMetadataField, boolean response) {
testResponse.put(customMetadataField, response);
}
public static boolean IsHandlerDisabled(Schema.SObjectType classType, string customMetadataField) {
if(Test.isRunningTest() && !testResponse.isEmpty()) {
if(testResponse.containsKey(customMetadataField)) {
return testResponse.get(customMetadataField);
}
}
// Query the Disable_Triggers__mdt CMDT based on the params and return a boolean
return true;
}
}
Now your test class can define the response from IsHandlerDisabled as required without even touching the Disable_Triggers__mdt CMDT.