I've built a simple trigger that will stop an update to a record based on a user's profile. In building a test method for this trigger, I don't see any way to simulate both sides of the processing, since the logic in the trigger is dependant on the results of the getUserInfo calls.
The issue, is how to get to 100% code coverage in a test method in this sort of situation?
What I'd like to be able to do in my test method is the following:
using my current admin login,
update 200 records (These would succeed, as the admin profile is allowed to make the updates)
switch login to a non-admin user login
update 200 records (These would not succeed, and the addError would be applied to the appropriate fields)