Can I run tests as a user of the "Local System"?

I am writing an integration test that requires a method to be run in a security context Local Systemto achieve the desired behavior. I could not achieve this. What should I do?

I am using C #, VS 2010, MsTest, and the target project is a Windows Service application.

+3
source share
2 answers

I see two options.

You can write a windows service.

This is not as much work as it seems. You can listen to commands using, for example, WCF. If you set the privilege of this service in Local System, you can run this service to test your device.

You can use scheduled tasks.

, , .

+1

: cmd , shoud nunit.exe...

+1

Source: https://habr.com/ru/post/1789475/


All Articles