7 respuestas
Hi , I just tested your code and test class in my org. Code coverage is 100%.
I just removed assert because from other trigger(in see in your other post) you are creating opp so count will be 2.@isTest
public class acctTempltTest
{
static testMethod void testMethod1()
{
Account testAccount = new Account();
testAccount.Name='Test Account' ;
insert testAccount;
Opportunity opp = new Opportunity(name= 'Opportunity', stagename='Prospecting',CloseDate=System.today().addMonths(1), Accountid=testAccount.id);
insert opp;
acctTemplt obj= new acctTemplt();
List<Opportunity> oppList = obj.getopptys();
obj.accountId = testAccount.id;
obj.oppr();
}
}
Please let us know if you this will help you. If you are getting any error then please share screen shot of your error