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
JimDeLongJimDeLong 

How does post install script impact code coverage

I'm writing a post install script to populate custom objects. How does it impact code coverage? Do I just call the class.method() in the testMethod script?
Best Answer chosen by JimDeLong
Ashish_SFDCAshish_SFDC
Hi Jim, 


The Package test is similar to the normal test, you have to create dummy records and call the methods in your Package which cover all the If & Else conditions to complete the code coverage. 

See the below links for more information, 

http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_install_handler.htm

http://www.salesforce.com/us/developer/docs/packagingGuide/Content/apex_post_install_script.htm

http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_testing_unit_tests_running.htm


Regards,
Ashish