You need to sign in to do that
Don't have an account?
Test Class Help
please help me in writing test coverage for this property
public String sortDirection = 'ASC';
public String sortExp = 'Model__r.ProductCategory__r.Name';
public string sortFullExp;
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;
}
Hi,
Can you give complete apex page and apex class coding. then only i will write test class.
Hi,
Try the following way,
@isTest(SeeAllData=true)
public class TEST_class1{
public static testMethod void test1(){
yourclassname c = new yourclassname();
// insert the records based on the codition for Model__r.ProductCategory__r.Name'
c.sortExp = 'give the inserted id for Model__r.ProductCategory__r.Name';
c.sortExpression = c.sortExp;
}
}
Hope so this helps you...!
Please mark this answer a Solution and please give kudos by clicking on the star icon, if you found this answer as helpful.