I am currently writing test coverage for a batch file I have in apex. I'm using a @Testsetup method to avoid rewriting some info over and over. Withing my controller I have this the following line
List<RecordType> rTypes = [select Id from RecordType where sObjectType = 'Opportunity' and DeveloperName = :cParent.OppRecordType__c];
The error I am getting says DML actions cannot be done to RecordType. How do I insert dummy data or make the test execute that query?
@TestSetup
static void prepareData(){
RecordType rt = new RecordType();
//assign values
insert rt;
The above is my code within my test class.