You need to sign in to do that
Don't have an account?
Test class for Class
can someone please help me in writing test class for this class:
public with sharing class BigMachinecls {
public static double getU(String BB, String Rools, String Foo, double qty, String teks){
double UQty = 0.0;
If ( (BB == null || BB == 'N') && (Rolls == null || Rolls == 'N') && (Foo == null || Foo == 'N') ){
UQty = qty /double.valueof(teks);
System.debug('@@@@@ inside getU method U : - Quantity - ' + UQty);
}
return UQty;
}//End of getU() method
public static double getMachineDetail( String machine1, String machineGroup, decimal qty, String checks){
double MachineDetailQuantity = 0;
If ( machine1.contains('tata') && (machine1.contains('Tek') ||
machine1.contains('X1')) && !machine1.contains('23HP') &&
!machine1.contains('125HP') && !machineGroup.contains('MECH_ALEN')){
MachineDetailQuantity = qty;
System.debug('@@@@@ inside getMachineDetail Qty : ' + MachineDetailQuantity );
}
return MachineDetailQuantity;
} // end of getMachineDetailQuantity method
}
Thanks in advance
Hi,
Below is test class with assertion as said by you:-
Let me know if you still have any issue.
All Answers
Hi,
Please try below test class. Also, please add system.asserts as per your requirement:-
Let me know if you have any question.
Thanks for the reply!!
assertion is failing here.
I tried this:
system.assertequals(5.0,dMacDet,'dMacDet failure in test');
Hi,
Same is working perfectly fine for me. Could you please check you class, have you made any changes in your methods?
except assertion is working fine..
if you have written assertion, can u pls post it here.
Thank you.
Hi,
Below is test class with assertion as said by you:-
Let me know if you still have any issue.
Thank you so much for your response.
Happy that it worked for you! Could you please also give me KUDOS for this, if you think I was able to help you.