function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Rahul MehataRahul Mehata 

Not able to cover the lines


I am not able to cover the below lines un test class. Can some one help please .

if(orderWrap.isSuccess == False && returnWrap.isSuccess == True ) {            
                        CS_SAPSFShipToOrderParser.shipToOrder orderItemWrap = new CS_SAPSFShipToOrderParser.shipToOrder();
                        List< CS_SAPSFShipToOrderParser.OrderList> orderListWrap = new List<CS_SAPSFShipToOrderParser.OrderList>();          
                        for(CS_SAPSFShipToReturnOrderParser.ReturnOrderResults forwrap : returnWrap.d.results){
                            CS_SAPSFShipToOrderParser.OrderList oWrap = new CS_SAPSFShipToOrderParser.OrderList();
                            oWrap.formattedDeliveryBlockReason = forwrap.formattedDeliveryBlockReason;
                            oWrap.formattedCreationDate = forwrap.formattedCreationDate;
                            oWrap.formattedDeliveryDate = forwrap.formattedDeliveryDate;
                            oWrap.formattedHeaderBillingBlockReason = forwrap.formattedHeaderBillingBlockReason;
                            oWrap.formattedpurchaseOrderByCustomer = forwrap.formattedpurchaseOrderByCustomer;
                            oWrap.formattedDeliveryDate = forwrap.formattedDeliveryDate;
                            oWrap.formattedSalesOrderType = forwrap.formattedCustomerReturnType;
                            oWrap.formattedtotalNetAmount = forwrap.formattedtotalNetAmount;
                            oWrap.formattedOverallSDProcessStatus = forwrap.formattedOverallSDProcessStatus;
                            oWrap.salesOrder = forwrap.customerReturn;   
                        orderItemWrap.results = orderListWrap;           
                        orderWrap.d = orderItemWrap;
                        orderWrap.checkForError = Label.CS_Orders + orderWrap.errorMessage;     
                        orderWrap.checkForSuccess = True;
SwethaSwetha (Salesforce Developers) 
HI Rahul,
The code provided in question does not highlight which lines of class are uncovered. Since this code requires an understanding of your implementation, it might not be possible to provide exact edit suggestions. However, the below articles give a good insight into how coverage can be improved and get started 

Examples of wrapper class test classes:
If this information helps, please mark the answer as best. Thank you