I am trying to test my Apex code to get over 75% code coverage.
I have the following code:
@isTest
private class Send_noti_emailsTestClass3 {
static testMethod void validateSend_noti_emails3() {
Query_and_upload myLicenseGenerator2 = new Query_and_upload();
myLicenseGenerator2.save(First_Name__c='Steve',Last_Name__c='Mark', Email__c='stevemark@gmail.com');
}
}
The Apex code has a PageReference sub called save and I need to pass the first name, last name and the email address.
public with sharing class Query_and_upload {
public PageReference save() {
if(inquery.first_name__c.length() == 0 && inquery.last_name__c.length() == 0 && inquery.email__c.length() == 0 ){
ApexPages.addMessage(new ApexPages.message(ApexPages.severity.INFO,'One of the inputs to filter the user is missing. Please enter all the fields.'));
}
}
But im getting the following error:
Error Error: Compile Error: Variable does not exist: First_Name__c at line
How can I pas the name and email to the save subroutine?