You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 23, 2023. It is now read-only.
Fix TestUserCredentialsPropertiesOnWindows without admin privileges
The System.Diagnostics.Process test TestUserCredentialsPropertiesOnWindows has two problems:
1) It requires admin privileges, and it looks like the intention was to silently bail from the test if such privileges weren't available, but instead it's causing the test to fail, which means outer loop tests fail when run without admin privileges.
2) When the exception is thrown, it's getting the error code from the wrong location: NetUserAdd returns the error code rather than having it available from GetLastWin32Error.
This commit addresses (2) simply by passing the result to Win32Exception, and it addresses (1) by catching the exception and returning instead of allowing it to propagate.
Eventually we'll need a better solution for such tests, but for now this should suffice.
0 commit comments