function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
coppelcoppel 

How do you write a unit test for a visualforce extension class?

Here is my class, I don't understand what I need to assert in a unit test.

 

 

public class massProjectCancellation {

public massProjectCancellation(ApexPages.StandardSetController controller) {
controller.setPageSize(100);
}

}

 

Here is my visualforce page that calls the above extension class.

 

 

<apex:page standardController="SFDC_Project__c" recordSetVar="projects" tabStyle="SFDC_Project__c" extensions="massProjectCancellation">
<apex:form >
<apex:pageBlock title="Cancel Projects" mode="edit">
<apex:pageMessages />
<apex:pageBlockButtons location="top">
<apex:commandButton value="Save" action="{!save}"/>
<apex:commandButton value="Cancel" action="{!cancel}"/>
</apex:pageBlockButtons>
<apex:pageBlockTable value="{!selected}" var="project">
<apex:column value="{!project.name}"/>
<apex:column headerValue="Status">
<apex:inputField value="{!project.SFDC_Project_Status__c}"/>
</apex:column>
<apex:column headerValue="Cancellation Reason">
<apex:inputField value="{!project.Cancellation_Reason__c}"/>
</apex:column>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>

 

 

 

 Thanks for any help!

 

Message Edited by coppel on 12-10-2009 01:12 PM
Message Edited by coppel on 12-10-2009 01:14 PM