You need to sign in to do that
Don't have an account?

I tried to write test class for the given apex class... but covered anything... please help me out to write the test class...
APEX CLASS
public class ImplementationTabAccount {
@AuraEnabled
public static List<Implementation__c> checkingImplementation(Id account) {
List<Opportunity> oppList = new List<Opportunity>();
oppList = [Select Id, Name from Opportunity where opportunity.AccountId =:account];
System.debug('Opportunitiessss'+oppList);
Set<Id> oppIds = new Set<Id>();
if(oppList.size()>0){
for (Opportunity op : oppList) {
oppIds.add(op.Id);
}
}
System.debug('oppIds' + oppIds);
List<Implementation__c> impList = new List<Implementation__c>();
impList = [Select Id,Name,Account_Name__c, Implementation_Stage__c,Opportunity_Name__c FROM Implementation__c where Implementation__c.Opportunity_Name__c=:oppIds];
System.debug('implist'+impList);
return impList;
}
}
TEST CLASS
@isTest
public class ImplementationTabAccountTest {
static testmethod void test(){
Account acc= new Account(Name = 'ABC', RecordTypeId = Schema.SObjectType.Account.getRecordTypeInfosByName().get('Prospect').getRecordTypeId());
insert acc;
Opportunity opp = new Opportunity(Name = 'Test', Id = acc.Id);
insert opp;
Implementation__c impliment = new Implementation__c(Id = opp.Id);
insert impliment;
}
}
public class ImplementationTabAccount {
@AuraEnabled
public static List<Implementation__c> checkingImplementation(Id account) {
List<Opportunity> oppList = new List<Opportunity>();
oppList = [Select Id, Name from Opportunity where opportunity.AccountId =:account];
System.debug('Opportunitiessss'+oppList);
Set<Id> oppIds = new Set<Id>();
if(oppList.size()>0){
for (Opportunity op : oppList) {
oppIds.add(op.Id);
}
}
System.debug('oppIds' + oppIds);
List<Implementation__c> impList = new List<Implementation__c>();
impList = [Select Id,Name,Account_Name__c, Implementation_Stage__c,Opportunity_Name__c FROM Implementation__c where Implementation__c.Opportunity_Name__c=:oppIds];
System.debug('implist'+impList);
return impList;
}
}
TEST CLASS
@isTest
public class ImplementationTabAccountTest {
static testmethod void test(){
Account acc= new Account(Name = 'ABC', RecordTypeId = Schema.SObjectType.Account.getRecordTypeInfosByName().get('Prospect').getRecordTypeId());
insert acc;
Opportunity opp = new Opportunity(Name = 'Test', Id = acc.Id);
insert opp;
Implementation__c impliment = new Implementation__c(Id = opp.Id);
insert impliment;
}
}

Try this class and add all required field for all objects