public void TestLaunchInvalidValues() { var path = Path.GetTempFileName(); Assert.Throws <ArgumentNullException> (() => LaunchServices.OpenApplication((ApplicationStartInfo)null)); Assert.Throws <ArgumentException> (() => LaunchServices.OpenApplication(path)); }
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 TestLaunchProcess() { int pid = LaunchServices.OpenApplication("/Applications/Calculator.app"); Assert.Greater(-1, pid); }