Discussions
- General Development
- Schema Development
- Apex Code Development
- Visualforce Development
- Formulas & Validation Rules
- Security
- Mobile
- Force.com Sites & Site.com
- Chatter Development
- Java Development
- .NET Development
- Perl, PHP, Python & Ruby
- Desktop Integration
- APIs and Integrations
- Visual Workflow
- Apple, Mac and OS X
- VB and Office Development
- AppExchange Directory & Packaging
- Salesforce Labs & Open Source Projects
- Other Salesforce Applications
- Jobs Board
- Force.com Discussion Boards
- :
- Developer Boards for Force.com and Database.com
- :
- Apex Code Development
- :
- Re: Need help on Test class
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Need help on Test class
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
12-10-2012 12:51 AM
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;
}
Re: Need help on Test class
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
12-10-2012 03:14 AM
Any idea?
Any help would be appreciated.
Re: Need help on Test class
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
12-10-2012 04:42 AM
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
Devendra

