jeudi 16 avril 2020
Missing test class coverage(Code Coverage NON)
I have written a test class to create PDF on quote. Can anyone help me with the test class and make the code coverage as 90% at least. Since the logic of my test class is wrong/ The test class is success but code coverage is none Apex class public class QuotePDF { public boolean show{get;set;} public id pdtId{get;set;} public Quote op{get;set;} public QuoteLineItem oli{get;set;} public string pb{get;set;} public Id opid{get;set;} public id prodid{get;set;} public list OliList{get;set;} public list OliCreate; public integer deleteIndex{get;set;} public QuotePDF() { show=false; oli=new QuoteLineItem(); op=new Quote(); OliList=new list(); OliCreate=new list(); } public void save(){ pricebook2 spbid=[select id from pricebook2 where isStandard=true limit 1]; opportunity o1=[select id from opportunity limit 1]; op.OpportunityId=o1.id; op.Pricebook2Id=spbid.id; upsert op; mappdtTopbemap=new map(); for(pricebookentry pb:[select product2id,id from pricebookentry where pricebook2id =:spbid.id ]) { pdtTopbemap.put(pb.product2id,pb.id); } for(QuoteLineItem o:OliList) { o.QuoteId=op.id; o.unitprice=o.unitprice; o.quantity=o.quantity; o.pricebookentryid=pdtTopbemap.get(o.product2id); o.Product2Id=o.product2id; OliCreate.add(o); } insert OliCreate; } public void AddOli() { show=true; QuoteLineItem olitemp = new QuoteLineItem(); OliList.add(olitemp); } public void deleteOpp() { OliList.remove(deleteIndex); } } VF
Inscription à :
Publier les commentaires (Atom)
Aucun commentaire:
Enregistrer un commentaire