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
vikas  malikvikas malik 

I got this error when i save my test class. Constructor not defined: [recordExt].<Constructor>()

here is my class..
@IsTest
public class TestrecordExt{
   
    static testMethod void TestEmp(){
   
        //test.startTest();
        List<employee__c> eList = new List<employee__c>();
        employee__c e = new employee__c();
        e.Name = 'test';
        e.Last_Name__c = 'test';
        e.Join_Date__c = Date.Today();
        e.City__c = 'test city';
        e.Phone__c = '123456';
        eList.add(e);
   
       
        e = new employee__c();
        e.Name = 'employee Name';
        e.Last_Name__c = 'emp Last Name';
        e.Join_Date__c = Date.Today();
        e.City__c = 'test city';
        e.Phone__c = '123456';
        eList.add(e);
       
        insert eList;
       
        recordExt r = new recordExt();
        r.saveEmp();
   
        //test.stopTest();
    }

}
Best Answer chosen by vikas malik
Gaurav NirwalGaurav Nirwal

Hi,

You did not define the default Constructor in your controller.
Create a Constructor in your controller like below.

public recordExt(){

}