I have a program that needs to run as a separate NT user to connect to a SQL Server databases. For running a program itself, this isn't a big deal as I can just right click on it in windows explorer and select run as. Is there any way to run my tests as a different user as well? (it would be nice if I could do so in Visual Studio)
Update: As of right now, I'm just unit testing using the integrated unit testing framework in Visual Studio 2008 Pro. I'm running them just using the "run all tests in current solution" menu option.
There's a command line program "runas", which you can use to run your tests as long as they are standalone programs. I'm not sure how exactly to integreate it with your tests, as I may need a bit more information on how you run them.
This method will ask you to enter your password.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With