3 answers
Hi Mayank,Please find the below piece of code. Please replace the custom fields with you API names where ever necessary. It covers 100% of the code.
If this solution helps, Please mark it as best answer.Thanks,@istest
public class Testforoppo {
static testMethod void TestUpdateClosedListPrice() {
Account acc = new Account(Name = 'Test Account');
insert acc;
Opportunity opp1 = new Opportunity (Name='Opp1',StageName='Stage 0 - Lead Handed Off',CloseDate=Date.today(), AccountId = acc.id);
insert opp1;
Opportunity opp2 = new Opportunity (Name='Opp1',StageName='Stage 0 - Lead Handed Off',CloseDate=Date.today(), composite_opportunity__c =opp1.id,AccountId = acc.id);
insert opp2;
delete opp2;
}
}