You need to sign in to do that
Don't have an account?
CapCbRM
Help with TestMethod
Hi DF,
I have completed a class to use as an extension of a VF page. I use it on a "Worldcolor_Project" page layout to show the Schedule associated with the project and the underlying Milestones attached to that Schedule.
The save and delete methods are used for VF buttons.
I am currently confused on how to begin my Testmethod. I started with Creating a new Worldcolor_Project and schedule related but am unsure how to test the inidividual methods. Any help would be greatly appreciated.
public with sharing class PullMilestones_Worldcolor { public Milestone__c[] milestones = new Milestone__c[0]; public Schedule__c[] scheduleinfo; public PullMilestones_Worldcolor(ApexPages.StandardController controller) { } public Milestone__c[] getMilestones() { milestones = [SELECT ID, Name, Duration__c, Status__c, Due_Date__c,Start_Date__c, Milestone_Status__c, Index__c, Predecessor_Index__c, Responsible__c FROM Milestone__c WHERE Worldcolor_ProjectID__c = :ApexPages.currentPage().getParameters().get('id') ORDER BY Index__c]; return milestones; } public void saveMile(){ UPDATE milestones; } public Schedule__c[] getSchedule() { scheduleinfo = [SELECT ID, Name, Details__c, Start_Date__c, End_Date__c, Method__c, Duration__c, Overdue_Milestones__c, Risk_Status__c, Schedule_Template__c FROM Schedule__c WHERE WorldColor_Project__c = :ApexPages.currentPage().getParameters().get('id')]; return scheduleinfo; } public void saveSched() { UPDATE scheduleinfo; } public void delSched() { DELETE scheduleinfo; } }
This got me to 95% so I can live with that :)