You need to sign in to do that
Don't have an account?
vara sree
how to improve code coverage of below test class
@isTest(SeeAllData=false)
private class TestOrderProductComponentController {
/*
public variables here
*/
public static NA_Order__c order4Test;
public static Account acc4Test;
/*
testMethod here
*/
static testMethod void testWithOutProduct() {
initalize();
OrderProductComponentController controller = new OrderProductComponentController();
Test.startTest();
Map<String, Set<String>> cropVarietyMap = controller.cropVarietyMap;
controller.queryTECP();
Map<String, Map<String, Map<String, Set<String>>>> TECPMapofMapTest = controller.TECPMapofMap;
NA_Order_Line_Item__c orderLineTest = controller.orderLine;
List<SelectOption> cropOptionsTest = controller.cropOptions;
List<SelectOption> varietyOptionsTest = controller.varietyOptions;
List<SelectOption> treatmentOptionsTest = controller.treatmentOptions;
List<SelectOption> enhancementOptionsTest = controller.enhancementOptions;
List<SelectOption> carrierOptionsTest = controller.carrierOptions;
List<SelectOption> packagingOptionsTest = controller.packagingOptions;
String cropTest = controller.crop;
String varietyTest = controller.variety;
controller.validateQuantity();
Test.stopTest();
}
static testMethod void testWithProducts() {
initalize();
OrderProductComponentController controller = new OrderProductComponentController();
Test.startTest();
Test.stopTest();
}
/*
initalize here
*/
public static void initalize() {
acc4Test = TestUtils.createAccount('AccForTestingOrderProductPicker', 'USD', true);
order4Test = TestUtils.createOrder('Spot Order', Date.today(), 'UPS', 'OrderForTestingOrderProductPicker', 'Created', acc4Test.Id, true);
PageReference orderProductPicker = Page.Order;
orderProductPicker.getParameters().put('Id', order4Test.Id);
Test.setCurrentPage(orderProductPicker);
}
}
private class TestOrderProductComponentController {
/*
public variables here
*/
public static NA_Order__c order4Test;
public static Account acc4Test;
/*
testMethod here
*/
static testMethod void testWithOutProduct() {
initalize();
OrderProductComponentController controller = new OrderProductComponentController();
Test.startTest();
Map<String, Set<String>> cropVarietyMap = controller.cropVarietyMap;
controller.queryTECP();
Map<String, Map<String, Map<String, Set<String>>>> TECPMapofMapTest = controller.TECPMapofMap;
NA_Order_Line_Item__c orderLineTest = controller.orderLine;
List<SelectOption> cropOptionsTest = controller.cropOptions;
List<SelectOption> varietyOptionsTest = controller.varietyOptions;
List<SelectOption> treatmentOptionsTest = controller.treatmentOptions;
List<SelectOption> enhancementOptionsTest = controller.enhancementOptions;
List<SelectOption> carrierOptionsTest = controller.carrierOptions;
List<SelectOption> packagingOptionsTest = controller.packagingOptions;
String cropTest = controller.crop;
String varietyTest = controller.variety;
controller.validateQuantity();
Test.stopTest();
}
static testMethod void testWithProducts() {
initalize();
OrderProductComponentController controller = new OrderProductComponentController();
Test.startTest();
Test.stopTest();
}
/*
initalize here
*/
public static void initalize() {
acc4Test = TestUtils.createAccount('AccForTestingOrderProductPicker', 'USD', true);
order4Test = TestUtils.createOrder('Spot Order', Date.today(), 'UPS', 'OrderForTestingOrderProductPicker', 'Created', acc4Test.Id, true);
PageReference orderProductPicker = Page.Order;
orderProductPicker.getParameters().put('Id', order4Test.Id);
Test.setCurrentPage(orderProductPicker);
}
}
Shashikant Sharma
Could you share the class which you are testing and explain which part of code is not covered.