You need to sign in to do that
Don't have an account?

Test Class for opportunity amount
write a soql query to display 100 opportunity record with amount greater than 10000 order by created date.Skip first 50 record and include record from recycle bin
//////Test class required for following code .Can anyone help in this considering all positive negative scenario
public class OpportunityClass {
public static list<Opportunity> toQueryOnOpportunity(){
list<Opportunity> listOpportunity = new List<Opportunity>([
SELECT
Id,
Name
FROM
Opportunity
WHERE
amount>10000
ORDER BY
CreatedDate ASC
LIMIT
100
OFFSET
12
ALL ROWS
]
);
System.debug(listOpportunity);
return listOpportunity;
}
}
//////Test class required for following code .Can anyone help in this considering all positive negative scenario
public class OpportunityClass {
public static list<Opportunity> toQueryOnOpportunity(){
list<Opportunity> listOpportunity = new List<Opportunity>([
SELECT
Id,
Name
FROM
Opportunity
WHERE
amount>10000
ORDER BY
CreatedDate ASC
LIMIT
100
OFFSET
12
ALL ROWS
]
);
System.debug(listOpportunity);
return listOpportunity;
}
}
Try the below code.
//************************************ class ********************************************
Thanks.
Akshay