Note The tests that you run as Local System should not create any user interfaces (UI). If your tests need to create or interact with UI, you need to move your UI-related code into separate executables that are launched on a desktop from your tests using CreateProcessAsUser function.
Test metadata can be used to specify the runas type of an assembly, class or test method.
Note RunAs values specified in metadata override RunAs values specified on the command line. For example, a test marked with runas:system test metadata will still be run as Local System even if /runas:elevated is specified on the command line.