You need to sign in to do that
Don't have an account?
Brian Cherry FWI
New Controller Test Class
This is my first controller, how would I go about testing this?
public class deliverablesController { // Constructor public deliverablesController(ApexPages.StandardController controller) { this.proj = (Professional_Services_Partner__c)controller.getSubject(); this.delivers = [ SELECT d.Name, d.Partner_Package__c, d.Price__c, d.Price_Override__c, Professional_Services_Partner_Contract__c, d.Id, d.QTY__c FROM Professional_Services_Partner_Line_Items__c d WHERE d.Professional_Services_Partner_Contract__c = :proj.id ]; } public pagereference insertmethod() { Professional_Services_Partner_Line_Items__c cc= new Professional_Services_Partner_Line_Items__c(); cc.Professional_Services_Partner_Contract__c = proj.id; insert cc; return null; } public Professional_Services_Partner_Line_Items__c[] getDeliverables() { return this.delivers; } // Action Method called from page button public pagereference saveChanges() { upsert this.delivers; pageRef.setRedirect(true); return pageRef; } // Action Method called from page link public pagereference newDeliverable() { Professional_Services_Partner_Line_Items__c d = new Professional_Services_Partner_Line_Items__c(); d.Professional_Services_Partner_Contract__c =this.proj.id; delivers.add( d ); getDeliverables(); return null; } public pagereference DeleteAccount() { // if for any reason we are missing the reference if (SelectedAccountId == null) { return null; } // find the account record within the collection Professional_Services_Partner_Line_Items__c tobeDeleted = null; for(Professional_Services_Partner_Line_Items__c a : this.delivers) if (a.Id == SelectedAccountId) { tobeDeleted = a; break; } //if account record found delete it if (tobeDeleted != null) { Delete tobeDeleted; } pageRef.setRedirect(true); return pageRef; } // class variables PageReference pageRef = new PageReference(ApexPages.currentPage().getUrl()); Professional_Services_Partner__c proj; Professional_Services_Partner_Line_Items__c[] delivers; public string SelectedAccountId { get; set; } }