You need to sign in to do that
Don't have an account?
Shikibu
how to test as self service user
I have a trigger on CaseComment that wants to run certain code only if the comment was posted by a selfserviceuser.
How can I exercise this code in a test class? System.RunAs will not accept a selfserviceuser as argument.
In my opinion, create a self service user and specify the username and all other required fields and try using System.runAs().
Refer the link http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_selfserviceuser.htm#topic-title for more details.
Hope this helps.
I had already tried this before posting my question:
Compile Error: runAs requires a single argument of type 'User' or 'Version' at line 9 col 9
Compile Error: Illegal assignment from SOBJECT:SelfServiceUser to SOBJECT:User at line 10 col 9