You need to sign in to do that
Don't have an account?
![domdick domdick](https://dfc-org-production.my.site.com/img/userprofile/default_profile_45_v2.png)
Need help on Test class
Hi,
I have following class for VF page. But without the test class, i can not process to Production site.
Can someone please help me to write a test class?
Many thanks in advace!
Class:
public String sortExpression { get { return sortExp; } set { //if the column is clicked on then switch between Ascending and Descending modes if(value == sortExp) sortDirection = (sortDirection == 'Asc')? 'Desc' : 'Asc'; else sortDirection = 'Asc'; sortExp = value; } } public String getSortDirection() { //if not column is selected if (sortExpression == null || sortExpression == '') return 'Asc'; else return sortDirection; } public void setSortDirection(String value) { sortDirection = value; }
Any idea?
Any help would be appreciated.
Domdick,
You will have to assign value to extsnion variables and then call class methods, something like below:
ExtensionClass ext = new ExtensionClass();
ext.sortDirection = 'ASC';
// call class methods using extension
ext.sortDirection = 'DESC';
// Call class methods using extension
Hope this helps :)
Thanks,
Devendra