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
Axaykumar VaruAxaykumar Varu 

Test method failure while inserting record from test method

Hi....All

 

I get test method failure while inserting record from testmethod

 


        Test.startTest();

 

MyTest__c testobj = new MyTest__c(Fileld1 = 'test');
       

insert testobj;
        
        ApexPages.StandardController controller = new ApexPages.StandardController(testobj);
        
        MyClass mc = new MyClass(controller);
       
        mc.save();
       

mc.cancel();
       

mc.stopTest();

bob_buzzardbob_buzzard

Can you tell us what the error is?