You need to sign in to do that
Don't have an account?
vara sree
how to improve code coverage below test class
@isTest(SeeAllData=false)
private class OrderProductComponentController_sindtest {
public static NA_Order__c orderTest;
public static Account accTest;
static testMethod void testWithProduct() {
initalize();
OrderProductComponentController_sind controller = new OrderProductComponentController_sind();
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();
}
public static void initalize() {
accTest = TestUtils.createAccount('AccForTestingOrderProductPicker', 'USD', true);
orderTest = TestUtils.createOrder('Spot Order', Date.today(), 'UPS', 'OrderForTestingOrderProductPicker', 'Created', accTest.Id, true);
PageReference orderProductPicker = Page.Order;
orderProductPicker.getParameters().put('Id', orderTest.Id);
Test.setCurrentPage(orderProductPicker);
}
}
private class OrderProductComponentController_sindtest {
public static NA_Order__c orderTest;
public static Account accTest;
static testMethod void testWithProduct() {
initalize();
OrderProductComponentController_sind controller = new OrderProductComponentController_sind();
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();
}
public static void initalize() {
accTest = TestUtils.createAccount('AccForTestingOrderProductPicker', 'USD', true);
orderTest = TestUtils.createOrder('Spot Order', Date.today(), 'UPS', 'OrderForTestingOrderProductPicker', 'Created', accTest.Id, true);
PageReference orderProductPicker = Page.Order;
orderProductPicker.getParameters().put('Id', orderTest.Id);
Test.setCurrentPage(orderProductPicker);
}
}
Suresh Raghuram
This is the test class but where is the actual class that need the code coverage.