I am writing one test class in which i have test the Selected Orders.
Here is my Main Class Code Portion which is not getting covered.
==Main Class code Portion======
for(Orderc cOrd: orderlist) {
if(cOrd.selected == true) {
Approval.ProcessWorkitemRequest req = new Approval.ProcessWorkitemRequest();
req.setComments(Comments);
req.setAction('Approve');
Id workItemId = getWorkItemId(cord.ord.id);
// submit the approval request for processing
if(workItemId == null){
cord.ord.addError('Error Occured');
}
}
}
Now here I am Not able to access the Selected Varibale which is in Wrapper Class As a Boolean Variable.
=====Wrapper Class code====
@TestVisible public class Orderc{
public Boolean selected {get; set;}
}
=====Test class code that i am tryinhg====
public class Br_MassOrderApprovalTest {
public static testMethod void VerifyOrders() {
Br_OrderwrapperClassController foo = new Br_OrderwrapperClassController();
Br_OrderwrapperClassController.Orderc obj = new Br_OrderwrapperClassController.Orderc();
//problem area:
obj .selected='true';
}
}
error: Variable does not exist: Br_OrderwrapperClassController.Orderc.selected
Can anyone please suggest, thanks.
'true'
) to your Boolean property?