}
}
+ [Test] // Covers #26363
+ public void GetProcesses_StartTime ()
+ {
+ foreach (var p in Process.GetProcesses ()) {
+ if (!p.HasExited && p.StartTime.Year < 1800)
+ Assert.Fail ("Process should not be started since the 18th century.");
+ }
+ }
+
[Test]
public void PriorityClass_NotStarted ()
{
{
if (RunningOnUnix)
// on unix, all characters are allowed
- return;
+ Assert.Ignore ("Running on Unix.");
string systemDir = Environment.GetFolderPath (Environment.SpecialFolder.System);
string exe = "\"" + Path.Combine (systemDir, "calc.exe") + "\"";
}
}
-#if NET_2_0
[Test]
public void Start_UseShellExecuteWithEmptyUserName ()
{
} catch (Win32Exception) {
}
}
-#endif
[Test] // Start (string, string)
public void Start4_FileName_Null ()
{
// Test requires cygwin, so we just bail out for now.
if (Path.DirectorySeparatorChar == '\\')
- return;
+ Assert.Ignore ("Test requires cygwin.");
Process p = new Process ();
p.StartInfo = new ProcessStartInfo ("/bin/sh", "-c \"sleep 2; echo hello\"");
}
}
- int bytesRead = -1;
+ public int bytesRead = -1;
-#if NET_2_0
// Not technically a 2.0 only test, but I use lambdas, so I need gmcs
[Test]
Assert.IsNull (e.InnerException, "IOE inner exception should be null");
}
-#endif
+
+ [Test]
+ public void Handle_ThrowsOnNotStarted ()
+ {
+ Process p = new Process ();
+ try {
+ var x = p.Handle;
+ Assert.Fail ("Handle should throw for unstated procs, but returned " + x);
+ } catch (InvalidOperationException) {
+ }
+ }
+
+ [Test]
+ public void HasExitedCurrent () {
+ Assert.IsFalse (Process.GetCurrentProcess ().HasExited);
+ }
}
}