+ Start a Discussion
rajubalajirajubalaji 

how can i cover a boolean in two test class

Dear friends,

How can i cover following line in test class.

public boolean Checked{get;set;}  //  This line is not covering in the test class.

if(att.Body != null) {
                        newBody = EncodingUtil.base64Encode(att.Body);
                    }

If anyBody Have idea please help me.

Thanks in advance.
 
Nikhil SutharNikhil Suthar
Hello,
https://developer.salesforce.com/forums/?id=9060G000000BhWHQA0
refer this.
and 
Boolean Checked = true;  //create your boolean value like this
Thanks
 
rajubalajirajubalaji
Hi Nikhil,

Thanks For Ur help but it was not covering the code part.

Thanks In Advance.
 
Nikhil SutharNikhil Suthar
Hi balaji karthik,
Can you post your class and Test class ?
Deepali KulshresthaDeepali Kulshrestha
Hi Balaji ,

Greetings to you!

You can use the below code

ClassName cls = New ClassName();
cls.fieldName=true;  

I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.

Thanks and Regards,
Deepali Kulshrestha
www.kdeepali.com