+ Start a Discussion
Nidhi MeshramNidhi Meshram 

how to cover empty method in a test class

Trigger having all the events so in handler there are two methods which i not able to cover how to cover this methods:-

public void afterDelete(SObject so) {
    }
    
    public void afterUndelete(SObject so) {
    }
Best Answer chosen by Nidhi Meshram
Steve Schreiner 4Steve Schreiner 4
Remove the unused events from the trigger. Why have them if never used?

All Answers

dinesh abcdinesh abc
your calling this two methods in your test class
dinesh abcdinesh abc
possible you can share your test class
Prachi Goel 17Prachi Goel 17
Hi ,@Nidhi Meshram
You can do like this:
ClassName.afterDelete(Pass object name here);
ClassName.afterUndelete(Pass Object name here);
Steve Schreiner 4Steve Schreiner 4
Remove the unused events from the trigger. Why have them if never used?
This was selected as the best answer
rohit singh 210rohit singh 210
Because of limited resources, it does not count as DML. 
check here the best collection of lord shiva quotes (https://www.statusvideosguru.com/2019/12/lord-shiva-quotes-status.html)
rohit singh 210rohit singh 210
<a href="https://www.statusvideosguru.com/2019/12/lord-shiva-quotes-status.html">lord shiva quotes</a>
Hin ChHin Ch
I have been struggling with this problem for some days, please give someone a best solution to it.
Regard,  (https://packagespoint.com)
Rohan sharma 54Rohan sharma 54
Armed with an experience of many decades, the company’s R&D division is consistently dedicated to produce new age products. Sakarni Power Putty being one of those products is prepared with an international grade of formulation where quality https://sakarni.com/wall-putty/ is of paramount at every step beginning with the detailed selection to the procurement of the raw material and delivery of the end product at the doorstep. In Sakarni Power Putty white cement, 
Rohan sharma 54Rohan sharma 54

Armed with an experience of many decades, the company’s R&D division is consistently dedicated to produce new age products. Sakarni Power Putty being one of those products is prepared with an international grade of formulation where quality wall putty (https://sakarni.com/wall-putty/ i) is of paramount at every step beginning with the detailed selection to the procurement of the raw material and delivery of the end product at the doorstep. In Sakarni Power Putty white cement, 
Muhammad SajjadMuhammad Sajjad
To cover the catch part of your class you have to throw some exceptions in your test class.
As we are not aware of your data model and validations so we can't suggest anything on what error should be thrown in your test class.
My Test on: https://seotoolcheckers.com/
Rohan sharma 68Rohan sharma 68
Because of limited resources 
if you like Shayari and feeling sad check out here the collection latest sad Shayari with images (https://shayariaboutlove.co/sad-shayari-with-images/) in Hindi 
S M Nahid EmonS M Nahid Emon
To cover the catch part of your class you have to throw some exceptions in your test class.
As we are not aware of your data model and validations so we can't suggest anything on what error should be thrown in your test class.

My Test on https://softowa.com/
S M Nahid EmonS M Nahid Emon
You are very welcome to our website Softowa. You can download the Windows software full version for free.

Softowa (https://pbase.com/softowa/profile)
S M Nahid EmonS M Nahid Emon
You are very welcome to our website Softowa. You can download the Windows software full version for free.

Softowa (https://t.co/VcRMHk7mjN)
S M Nahid EmonS M Nahid Emon
You are very welcome to our website Softowa. You can download the Windows software full version for free.

BitLy (https://bit.ly/softowa)
S M Nahid EmonS M Nahid Emon
You are very welcome to our website Softowa. You can download the Windows software full version for free.

Bitly.ws (http://bitly.ws/dWVe)
S M Nahid EmonS M Nahid Emon
You are very welcome to our website Softowa. You can download the Windows software full version for free.

Bitly.com (http://bitly.com/softowa)
S M Nahid EmonS M Nahid Emon
To cover the catch part of your class you have to throw some exceptions in your test class.
As we are not aware of your data model and validations so we can't suggest anything on what error should be thrown in your test class.

My Test on https://softowe.com/
S M Nahid EmonS M Nahid Emon
You are very welcome to our website Softowe. You can download the Windows software full version for free.

Windows 11 Preactivated - https://softowe.com/microsoft-windows-11/
S M Nahid EmonS M Nahid Emon
You are very welcome to our website Softowe. You can download the Windows software full version for free.

Windows 11 Preactivated - https://images.google.kg/url?sa=t&url=https%3A%2F%2Fsoftowe.com%2F (https://images.google.kg/url?sa=t&url=https%3A%2F%2Fsoftowe.com%2F)
S M Nahid EmonS M Nahid Emon
You are very welcome to our website Softowe. You can download the Windows software full version for free.

Windows 11 Preactivated - https://images.google.bi/url?sa=t&url=https%3A%2F%2Fsoftowe.com%2F (https://images.google.bi/url?sa=t&url=https%3A%2F%2Fsoftowe.com%2F)
S M Nahid EmonS M Nahid Emon
You are very welcome to our website Softowe. You can download the Windows software full version for free.

Windows 10 Preactivated - https://images.google.ga/url?sa=t&url=https%3A%2F%2Fsoftowe.com%2F (https://images.google.ga/url?sa=t&url=https%3A%2F%2Fsoftowe.com%2F)
S M Nahid EmonS M Nahid Emon
You are very welcome to our website Softowe. You can download the Windows software full version for free.

Windows 7 Preactivated - https://images.google.al/url?sa=t&url=https%3A%2F%2Fsoftowe.com%2F (https://images.google.al/url?sa=t&url=https%3A%2F%2Fsoftowe.com%2F)
S M Nahid EmonS M Nahid Emon
For all American airlines inquiries, including new American airline reservations, changing or canceling your reservation, or flight information. please contact the reservations number for American airlines flights for changes cancellation at 1-888-603-3369.

For more information contact with American Airlines customer care (https://sites.google.com/view/changes-cancellationaa
S M Nahid EmonS M Nahid Emon
Tus sueños son nuestras metas. Nos apasiona ayudarlo a lograrlos, y nuestros pacientes lo experimentan en todo lo que hacemos. Lea algunas historias de éxito de nuestros pacientes y escuche sobre su viaje de fertilidad con Panama Fertility.

Fecundación In Vitro (https://www.panamafertility.com/), Inseminacion Artificial (https://www.panamafertility.com/), Ovodonacion (https://www.panamafertility.com/), Infertilidad, Fertilidad (https://www.panamafertility.com/), Reproduccion Asistida (https://www.panamafertility.com/), Embarazo (https://www.panamafertility.com/)
S M Nahid EmonS M Nahid Emon
Tech Nahid (https://www.technahid.com/) Share Regular Online Earning Tips and Tricks for All Types of Bloggers and Content Writers. Also Sharing Top Blogger & WordPress Themes.
Tech Nahid (https://www.google.com/url?q=https%3A%2F%2Fwww.technahid.com%2F), Online Earning (https://www.youtube.com/redirect?q=https%3A%2F%2Fwww.technahid.com%2F), Blogger Templates (https://maps.google.com/url?q=https%3A%2F%2Fwww.technahid.com%2F), WordPress Templates (https://plus.google.com/url?q=https%3A%2F%2Fwww.technahid.com%2F)
 
S M Nahid EmonS M Nahid Emon
To cover the catch part of your class you have to throw some exceptions in your test class.
As we are not aware of your data model and validations so we can't suggest anything on what error should be thrown in your test class.
My Test on https://leeapk.com
Small SeoToolsSmall SeoTools
To cowl the capture part of your elegance you have to throw a few exceptions to your test elegance.
As we are not aware about your data version and validations so we can't endorse something on what errors have to be thrown on your take a look at magnificence.
article rewritter (https://smallseotoolscom.com/small-seo-tools-article-rewriter/)
Small SeoToolsSmall SeoTools
You are very welcome to our website


plagrism checker (https://smallseotoolscom.com/small-seo-tools-plagiarism-checker/)
S M Nahid EmonS M Nahid Emon
Free PUBG Mobile UC (https://softowe.com/get-free-pubg-mobile-uc/) in any account latest trick.
S M Nahid EmonS M Nahid Emon
Follow softowe official (https://softowe.com) youtube channel for the latest updates.