function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Mathieu CanyMathieu Cany 

Testing code Help

Hi,

 

I founded a perfect exemple of a tool that i would like to deploy in my salesforce prodution environment. on this link :

http://www.forcetree.com/2010/04/expand-collapse-pageblock-table-columns.html

 

But I Have to test this code provided by the author :

 

public class nestedqueryexample
{
  public List<Account> getaccsandtmember()
  {
      List<Account> accounts = [Select Id,(Select TeamMemberRole, User.Name From Account.AccountTeamMembers), Name, BillingCountry from Account];
      return accounts;
  }
}

 

What is the point to give a code if i can't deploy it easily ? Is It means that the author have written a testing code, and delete it before to put his solution online ?

 

If I have to develop a testing code for a very basic query like that, what will be the appropiate code / test method  for testing it ?

 

Thanks for your support.

 

gm_sfdc_powerdegm_sfdc_powerde

You should probably try this out in DE org (you can sign up for one from developer.force.com) or from your sandbox.  These environments don't have the restriction of code coverage and are the best places to play around with sample code.


Mathieu Cany wrote:

Hi,

 

I founded a perfect exemple of a tool that i would like to deploy in my salesforce prodution environment. on this link :

http://www.forcetree.com/2010/04/expand-collapse-pageblock-table-columns.html

 

But I Have to test this code provided by the author :

 

public class nestedqueryexample
{
  public List<Account> getaccsandtmember()
  {
      List<Account> accounts = [Select Id,(Select TeamMemberRole, User.Name From Account.AccountTeamMembers), Name, BillingCountry from Account];
      return accounts;
  }
}

 

What is the point to give a code if i can't deploy it easily ? Is It means that the author have written a testing code, and delete it before to put his solution online ?

 

If I have to develop a testing code for a very basic query like that, what will be the appropiate code / test method  for testing it ?

 

Thanks for your support.