You need to sign in to do that
Don't have an account?
sfLearner0201
Urgent : Code Coverage of onInstall
Hi ,
Can anyone help me cover this picece of code. I am trying such that whenever someone installs my managed package a schdeule runs which calls a method to execute.
My Code is below :
global without sharing class PostInstallClass implements InstallHandler { //public system.Version cotext{get;set;} global void onInstall(InstallContext context) { if(context.previousVersion() == null) { //cotext = System.requestVersion(); ScheduleCodeUpdate objhclass = new ScheduleCodeUpdate(); system.schedule('ScheduleclassEveryhour', CRON_STRING , objhclass); } } // execute }// class PostInstallClass
and my Test Class is :
@istest public without sharing class TestPostInstallClass { public static void TestPostInstallClass() { PostInstallClass postinstall = new PostInstallClass(); Test.testInstall(postinstall, null); // Test.testInstall(postinstall, postinstall.cotext , false); } }
Code Samples to cover Schedule Code of Managed Package are highly appreciated.
Thank You.
Hi,
Please add "testmethod". This will give you the solution.
Important :
Hit Kudos if this provides you with useful information and if this is what you where looking for then please mark it as a solution for other benefits.
Thank You