You need to sign in to do that
Don't have an account?

Condition is not covering in test class
Hello All,
i have created test record in test class, after i created record
i have created record
ex:
with the above code i cant cover the condition acc.recordtype.name=='Sample record type' , but data was inserted properly,
kindly tel me how to fix the above issue. please take it urgent.
thanks advance to all
i have created test record in test class, after i created record
for(account acc: alist) { system.debug( '@@@@'+acc.recordtype.name); this values is null system.debug( '$$$$'+acc.ischecked); // this values true if(acc.recordtype.name=='Sample record type' & acc.ischecked==true) { // logic // }in test class
i have created record
ex:
testmethod () { account acc= new acc( recordtypeid=// sme logic to fetch id name='ssssss' ,ischecked = true) insert acc }
with the above code i cant cover the condition acc.recordtype.name=='Sample record type' , but data was inserted properly,
kindly tel me how to fix the above issue. please take it urgent.
thanks advance to all
what ever you have suggested i already done , inserted record in test class. even after insert record also system.debug( '@@@@'+acc.recordtype.name) always returning NULL from the class
If not then please update your code like below and use recordTypeId only Your Test class code should be like below
Let us know if this will help you
Thanks
Amit Chaudhary
i have created test data for account , properly by includeing record type,
even this test data i have created and queried also also in the debug statements record type id always displaying null
my issue not yet soloved :( , kindly help me