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

Test Class for the Quote
Hi All,
Can someone help me with test class for the below apex class?
public class DisplayQuote
{
public List<Quote> allquotes{get;set;}
public Boolean result{get;set;}
public Id quoteId {get;set;}
public DisplayQuote(ApexPages.StandardController stdController)
{
sObject quote = stdController.getRecord();
quoteId = (Id) quote.get('Id');
String rowsString = ApexPages.currentPage().getParameters().get('rows');
if (rowsString == null || rowsString == '')
{
rowsString = '10';
}
if (rowsString == 'All')
{
rowsString = '1000';
}
Integer rows = Integer.valueOf(rowsString);
allQuotes = new List<Quote>([SELECT Opportunity.Account.Name, Opportunity.name,OpportunityId, Name, IsSyncing, Id, ExpirationDate, Discount, CreatedById, Status From Quote WHERE Status = 'Review Pending' limit :rows]);
if (allQuotes.isEmpty())
result = false;
else
result = true;
}
}
Can someone help me with test class for the below apex class?
public class DisplayQuote
{
public List<Quote> allquotes{get;set;}
public Boolean result{get;set;}
public Id quoteId {get;set;}
public DisplayQuote(ApexPages.StandardController stdController)
{
sObject quote = stdController.getRecord();
quoteId = (Id) quote.get('Id');
String rowsString = ApexPages.currentPage().getParameters().get('rows');
if (rowsString == null || rowsString == '')
{
rowsString = '10';
}
if (rowsString == 'All')
{
rowsString = '1000';
}
Integer rows = Integer.valueOf(rowsString);
allQuotes = new List<Quote>([SELECT Opportunity.Account.Name, Opportunity.name,OpportunityId, Name, IsSyncing, Id, ExpirationDate, Discount, CreatedById, Status From Quote WHERE Status = 'Review Pending' limit :rows]);
if (allQuotes.isEmpty())
result = false;
else
result = true;
}
}
Please check if this works.