You need to sign in to do that
Don't have an account?
chiranjib rout
As i am new to this can anyone please help me to write a test class for the above class;
Thanks in Advance
Need help on code coverage for json deserialize parser
public class OrderSimulate_Res_Parser { public class ET_ITEMLIST { public String ITM_NUMBER; public String MATERIAL; public String REQ_QTY; public String AVL_QTY; public String ABS_DISCOUNT; public String PERC_DISCOUNT; } public Row row; public class Row { public String TAX_AMOUNT_HD; public String EX_EXCEPTION; public String EV_SALES_ORDER; public String ET_MESSAGES; public String EX_CR_BLOCK; public String IV_ORDER_DISCOUNT; public List<ET_FREIGHT_OPTIONLIST> ET_FREIGHT_OPTIONLIST; public List<ET_ITEMLIST> ET_ITEMLIST; } public class ET_FREIGHT_OPTIONLIST { public String SHIP_DESC; public String FREIGHT_VAL; public String REQ_DATE; public String SHIP_COND; } public static SCP_OrderSimulate_Res_Parser parse(String json) { return (SCP_OrderSimulate_Res_Parser) System.JSON.deserialize(json, SCP_OrderSimulate_Res_Parser.class); } }
As i am new to this can anyone please help me to write a test class for the above class;
Thanks in Advance
Can you post the test class code you have written so far and highlight the lines of code (from class in bold)that need coverage so the community can help?
Relevant examples of code Coverage for JSON.Deserialize object in apex test classes:
https://salesforce.stackexchange.com/questions/104288/code-coverage-for-json-deserialize-object-in-apex-test-classes-in-salesforce
https://developer.salesforce.com/forums/?id=9062I000000g5TqQAI
If you are looking for a writing test class from scratch, the below post should help you get started
Code Coverage Best Practices
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_code_coverage_best_pract.htm
Checking Code Coverage
https://help.salesforce.com/articleView?id=code_dev_console_tests_coverage.htm&type=5
https://salesforce.stackexchange.com/questions/148894/help-required-to-get-full-code-covered-in-test-class
Hope this helps you. Please mark this answer as best so that others facing the same issue will find this information useful. Thank you