+ Start a Discussion
Shivani ThaparShivani Thapar 

how can I test this piece of code so I can deploy it for visual force email

public class FindunpaidInvoices {
    private final List<Invoice_Consulting__c> invoices;

    public FindunpaidInvoices() {
        invoices = [select Account__c, Invoice_Date__c, Balance_Due__c from Invoice_Consulting__c where Name = 'Unpaid'];
    }

    public List<Invoice_Consulting__c> getUnpaidInvoices() {
        return invoices;
    }
}
nitesh gadkarinitesh gadkari
@IsTest
 public static void Testmethod Method(){
   FindunpaidInvoices  FindInvoices=new FindunpaidInvoices ();
   
   FindInvoices.FindunpaidInvoices();
   List<Invoice_Consulting__c> test=FindInvoices.getUnpaidInvoices();
   system.assert(test.size()>0);
 }
Regards
Nitesh
 
Shivani ThaparShivani Thapar
thanks but I get this error with that test code.. Error: Compile Error: unexpected token: 'void' at line 2 column 15 Thoughts? thx