I'm trying to put a webservices class into production but its telling me my code coverage is only 58%. I'm familiar with having to write a test class for triggers but what if this is a just a class, how do you make sure this code hits the 75%?
global class ClientAllocation {
WebService static List<Account> getAccount()
{
string strQuery = 'select Name, CASESAFE_ID__c, Production_environment__c, External_Identifier__c, Member_Web_URL__c, Administration__c, Pensions__c, Broking__c, Helpdesk__c, Helpdesk_Email__c, Helpdesk_Number__c, Account_Owner_Name__c, Darwin_Support_Associate__c, Selection_Window_Open_Month__c WHERE Type = Client';
return Database.query(strQuery);
}
}
return [select Name, ...];
so the query is checked at compile time. You still need to write a test though.