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
ImmuImmu 

Can anybody write test class for this trigger

trigger NewTrig on Account (before insert) {
for(account a:trigger.new)
{
if(a.Name=='India')
{
a.NumberOfEmployees=10;
}
}
}
Sonam_SFDCSonam_SFDC
Hi Immu,

Logic: I suggest you create an account through test class with Name as India and then use assert to check the value of NumberofEmployees field to see if it updates to 10.

Sample Code available on the following link : http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_testing_example.htm