You need to sign in to do that
Don't have an account?
Lightning User
Login as someone else
Hi,
I'm making a test Apex class that checks against the current user profile. The problem is that there won't be enough code coverage if the user running the test is a system administrator. Is it possible to write apex code in the test class that logs in as a different user for the test, and it's still possible to run the test as a system administrator? Please help, thanks.
runAs method, perhaps....:)
http://www.salesforce.com/us/developer/docs/apexcode/index_Left.htm#StartTopic=Content/apex_testing_tools_runas.htm
All Answers
runAs method, perhaps....:)
http://www.salesforce.com/us/developer/docs/apexcode/index_Left.htm#StartTopic=Content/apex_testing_tools_runas.htm