I have written a apex class with test class both are running but my code coverage is only 66%.Please help to solve the problem.
Apex Class-
global class Deleteoppotest implements Schedulable{
global void execute(SchedulableContext SC) {
deleteoppo();
}
public static void deleteoppo() {
for(List<opportunity> objoppo : [SELECT Id FROM opportunity WHERE CreatedDate <= :(Date.Today() - 200) LIMIT 10])
{
delete objoppo;
}
}
}
Test Class
@isTest
private class Deleteoppotestcls {
static testMethod void myUnitTest() {
// TO DO: implement unit test
Opportunity op = new Opportunity();
op.Name = 'test1';
op.StageName = 'Qualified';
op.CloseDate = Date.Today();
op.Description ='testingoppotestcls';
op.Business_Type__c = 'Domestic';
insert op;
Deleteoppotest.deleteoppo();
}
}