public void TestLaunchProcessAPIsForInvalidAppBundles() { var path = Util.CreateTmpDir("NonExisting.app"); Assert.AreEqual(-1, LaunchServices.OpenApplication(path)); Assert.AreEqual(-1, LaunchServices.OpenApplication(new ApplicationStartInfo(path))); NSRunningApplication app = LaunchServices.OpenApplicationInternal(new ApplicationStartInfo(path)); Assert.IsNull(app); }
public void TestLaunchProcessAndTerminate() { NSRunningApplication app = LaunchServices.OpenApplicationInternal(new ApplicationStartInfo("/Applications/Calculator.app")); try { Assert.IsNotNull(app); Assert.That(app.ProcessIdentifier, Is.GreaterThan(-1)); } finally { Assert.IsTrue(app.Terminate(), "Could not kill Calculator app"); } }