
10 respuestas

Hi Yuchen,Well thanks for your reply on this, you are partially correct, I actually resolved this few days back.1. Used @isTest(seeAllData='true') on the top class level and just called the methods of controller in the Test Class.2. As it was my sandbox on which I had my report and controller classes defined, I just created few test records to make the reports have some records under it, this resolved half of the problem. I wrote the below query in my Test Class so that I get some records from the report to pass the Test Class. List <Report> reportList1 = [SELECT Id, DeveloperName FROM Report where DeveloperName = 'my_Report_API_Name'];
Thanks for all help on this post,@isTest(seeAllData='true')
public class last30DayCallsController_TestHelper
{
public static Integer count=0;
public static integer Target;
public static testMethod void table(){
test.startTest();
List <Report> reportList1 = [SELECT Id, DeveloperName FROM Report where DeveloperName = 'my_Report_API_Name'];
last30DayCallsController.Data1 data1 = new last30DayCallsController.Data1(600, Count);
last30DayCallsController.getData1(); //controller method call
last30DayCallsController.allPlcmt1(); //controller method call
test.stopTest();
}
}