Sometimes we have to write code that executes differently if the Apex is being tested. For a great example, check out Scott Hemmeter's blog post on testing webservice callouts at http://sfdc.arrowpointe.com/2009/05/01/testing-http-callouts/. Scott's example works well, and he uses a Boolean isApexTest, running certain code if this is true or false. I used to do something […]
System Replacement For isTest Apex Method
Sometimes we have to write code that executes differently if the Apex is being tested. For a great example, check out Scott Hemmeter's blog post on testing webservice callouts at http://sfdc.arrowpointe.com/2009/05/01/testing-http-callouts/. Scott's example works well, and he uses a Boolean isApexTest, running certain code if this is true or false. I used to do something […]