function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
S.Mac-IntoshS.Mac-Intosh 

Apex code (Average test coverage 0%)

How can i get the 'Average test coverage' of the following code to 75%? It is 0% ATM. My code:

 

Public with sharing class InsertClass{

Public string InsertTestObject{

Get{

TestObject__c Record = [SELECT Testobject__c.name FROM Testobject__c WHERE Id ='a0Cb0000000Tvw5'];
TestObject__c newRecord = Record.clone(false, true);
System.debug('Naam van testobject die wordt gekopieerd ' + newRecord );

newRecord.name = Record.Name + ' CLONE';
System.debug('Naam van testobject die wordt geinsert ' + newRecord.name );
insert newRecord;

return newRecord.id ;
}
}