You need to sign in to do that
Don't have an account?
test class 66% coverage
Hi, I have tested my trigger, but the coverage of the code reached 66% even if the test of the class was successfully, how can I reach 75%? 
this was the class:
@isTest
private class ErrorMessagetestclass {
Static testmethod void myTest(){
Opportunity opp = new Opportunity ();
opp.Name = 'Test';
opp.StageName = 'Qualification';
opp.CloseDate = Date.parse('12/10/2021');
opp.Type = 'Supplier';
insert opp;
}
}
Thanks
@isTest
private class ErrorMessagetestclass {
Static testmethod void myTest(){
Opportunity opp = new Opportunity ();
opp.Name = 'Test';
opp.StageName = 'Qualification';
opp.CloseDate = Date.parse('12/10/2021');
opp.Type = 'Supplier';
insert opp;
}
}
Thanks
Try Below Code Please Mark It As Best Answer If It Helps
Thank You!
This was the code that gave me 100% coverage:
@isTest
private class ErrorMessagetestclass {
Static testmethod void myTest(){
Opportunity opp = new Opportunity ();
opp.Name = 'Test';
opp.AccountID= '0042d0001064Oo9BAE';
opp.StageName = 'Qualification';
opp.CloseDate = Date.parse('12/10/2021');
opp.Type = 'Supplier';
insert opp;
}
}
Thanks again @CharuDutt :)