You need to sign in to do that
Don't have an account?
Testing exception block when calling another method
Hey Guys!
Although I have >95% code coverage, however, I'd still like to get it to 100% and need some guidance with the following :)
How would you enter the Exception block below via Test Class? Passing an empty string to method1 probably won't work. Any other ideas that would force this to happen?
Although I have >95% code coverage, however, I'd still like to get it to 100% and need some guidance with the following :)
How would you enter the Exception block below via Test Class? Passing an empty string to method1 probably won't work. Any other ideas that would force this to happen?
public class SomeClass { public static void method1(List<String> strings) { List<SObject> sObjects = [Select Id, Name FROM SObject WHERE Id IN :strings]; if (sObjects.size() > 0) { for (SObject sObj : sObjects) { try { method2(sObj); } catch (Exception ex) { System.debug('***EXCEPTION***'); ex.getStackTraceString(); } } } } public static void method2(SObject sObj) { //Do something here } }Any help would be appreciated. Thanks!
http://officesetups.uk/
http://webroot-safe.me/
http://rand-mcnally-gps-update.com
http://garmincomexpress.live/
http://garminexpresss.com/
http://trendmicro-logins.com
http://nortoncomsetupl.com/
http://aolmaill.de
http://norton-comnu16.com/
http://mcafeedownload.de/