public void FindOnPathSucceeds() { string expectedCmdPath; string shellName; if (NativeMethodsShared.IsWindows) { #if FEATURE_SPECIAL_FOLDERS expectedCmdPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), "cmd.exe"); #else expectedCmdPath = Path.Combine(FileUtilities.GetFolderPath(FileUtilities.SpecialFolder.System), "cmd.exe"); #endif shellName = "cmd.exe"; } else { expectedCmdPath = "/bin/sh"; shellName = "sh"; } string cmdPath = ToolTask.FindOnPath(shellName); Assert.Equal(expectedCmdPath, cmdPath, StringComparer.OrdinalIgnoreCase); }