You need to sign in to do that
Don't have an account?
Egor Palatov
how to write test class for this sort method?
public String sortExpression{ get{ return sortExp; } set{ if (value == sortExp){ sortDirection = (sortDirection == 'ASC')? 'DESC' : 'ASC'; } else{ sortDirection = 'ASC'; sortExp = value; } } } public String getSortDirection(){ if (sortExpression == null || sortExpression == ''){ return 'ASC'; } else{ return sortDirection; } } public void setSortDirection(String value){ sortDirection = value; } public PageReference ViewData(){ String sortFullExp = sortExpression + ' ' + sortDirection; items = Database.query('SELECT Id, Name, Type__c,Quantity__c,ProductionDate__c,Price__c,InStock__c,AddDate__c,Image__c FROM Item__c order by ' + sortFullExp); return null; }
You want to write the test class for this complete class..? If not can you specify the method for which you want the test class..?
Thank You,
Rajesh.
Can you post the complete class...?
What ever you have posted is all the method..
Thank You.
Rajesh.