You need to sign in to do that
Don't have an account?
street
Testcase for below class?
public with sharing class Single_Invoice { //Date d1; Set<Id> tskNo = new Set<Id>(); public List<Opportunity> opp99{get;set;} public Opportunity userInputAppointment {get; set;} public Opportunity o1 {get; set;} public Opportunity[] o ; public account[] acct ; Set<Id> oppacctname = new Set<Id>(); public Task[] t; //public invoice__c[] inv; public Task[] tsk ; public ApexPages.StandardSetController con { get { if(con == null) { userInputAppointment = new Opportunity(); userInputAppointment.From_Date__c=Date.valueof(ApexPages.currentPage().getParameters().get('fromdate')); userInputAppointment.To_Date__c=Date.valueof(ApexPages.currentPage().getParameters().get('todate')); tsk=[select id, description,whatid,ActivityDate, who.type,subject, whoid from task where Priority='Renewal' and ActivityDate>=:userInputAppointment.From_Date__c and ActivityDate<=:userInputAppointment.To_Date__c]; for(Task aa: tsk) { tskNo.add(aa.whatid); } con = new ApexPages.StandardSetController(Database.getQueryLocator ([select id,name, Account.FirstName ,CloseDate, Director_ID__r.AccountId , Director_ID__r.FirstName , Director_ID__c,Amount,Account.Name, Account.Id ,Account.Director_ID__c,Start_Issue__c,Expire_Issue__c, Account.Salutation ,Invoice_Effort__c,Payment_Date__c,Refunded_Amount__c, Account.Mailing_Address__c,Account.Mailing_Ste_Apt__c, Account.Mailing_State__c,Account.Mailing_City__c,Tax__c,Total__c, Account.Mailing_Zip__c from Opportunity where id in:tskNo and recordType.id=:'012V0000000CgYl'])); // sets the number of records in each page set con.setPageSize(1000); } return con; } set; } /* public ApexPages.StandardSetController con { get { if(con == null) { opp99=(List<opportunity>)con3.getRecords(); for(opportunity oo1: opp99) { oppacctname.add(oo1.AccountId ); } con = new ApexPages.StandardSetController(Database.getQueryLocator([Select id,Salutation,Verification_Date__c,FirstName ,PersonFirstNameLocal,Asset_Size__c,Mailing_Address__c,Mailing_Ste_Apt__c,Mailing_City__c,Mailing_Zip__c,Mailing_State__c,Director_ID__c,Bank_Status__c,Bill_To__c ,name,Bill_To__r.Id FROM Account where id in:oppacctname order by name ])); // sets the number of records in each page set con.setPageSize(1000); } return con; } set; } public List<Account> getAccounts() { return (List<Account>)con.getRecords(); } */ public List<opportunity> getopp() { return (List<opportunity>)con.getRecords(); } // returns the page number of the current page set public Integer pageNumber { get { return con.getPageNumber(); } set; } // returns the next page of records public void next() { con.next(); } // indicates whether there are more records before the current page set. public Boolean hasPrevious { get { return con.getHasPrevious(); } set; } // returns the first page of records public void first() { con.first(); } // returns the last page of records public void last() { con.last(); } // returns the previous page of records public void previous() { con.previous(); } public PageReference deliverAsPDF() { PageReference pdf = new PageReference('/apex/Single_Invoice_VF'); // PageReference pdf = Page.page; pdf.getParameters().put('p','p'); return pdf; } /* public account[] getacct() { return acct; } public Opportunity[] geto() { return o; } public Task[] gett() { return t; } public Task[] gettsk() { return tsk; } */ }
Hi
I believe, you wanted a test class for your class. If so, Try this testMethod:
Let me know if you face any issues with this! :)
All Answers
Hi
I believe, you wanted a test class for your class. If so, Try this testMethod:
Let me know if you face any issues with this! :)
Thanks Shruthi, its working :)