You need to sign in to do that
Don't have an account?

testMethod doesn't recognize Account or custom obj - unexpected token error
Hi all,
I have a working trigger which I'm trying to write a testMethod for in Eclipse.
I have created a new class to put the testMethod in, but I am getting an error 'unexpected token SFDC_Special_Event__c' here is my code:
I also get the error if I change SFDC_Special_Event__c to the standard Account object. It seems none of the objects are being recognized. What am I missing? I can see the custom object in the project treeview.
Cheers
I have a working trigger which I'm trying to write a testMethod for in Eclipse.
I have created a new class to put the testMethod in, but I am getting an error 'unexpected token SFDC_Special_Event__c' here is my code:
Code:
public class aTest { static testMethod void test_dupeBooking { SFDC_Special_Event__c myBooking = new SFDC_Special_Event__c(Name='one'); //SFDC_Special_Event__c[] bks = new SFDC_Special_Event__c[] { bk1 }; //insert bks; } }
I also get the error if I change SFDC_Special_Event__c to the standard Account object. It seems none of the objects are being recognized. What am I missing? I can see the custom object in the project treeview.
Cheers
Now when I run the test, I get an error - see screenshot. Is this error because of a validation rule? I have validation rules and required fields, my testMethod only defines a 'Name' for the inserted obj.