public void ThrowsIfSikuliHomeIsSetAndFileDoesNotExist() { Environment.SetEnvironmentVariable("SIKULI_HOME", @"C:\Temp", EnvironmentVariableTarget.Process); var processFactory = new SikuliScriptProcessFactory(); processFactory.Start(processFactory.GetSikuliVersion()); }
public void ThrowsIfSikuliHomeIsNotSet() { Environment.SetEnvironmentVariable("SIKULI_HOME", null, EnvironmentVariableTarget.Process); var processFactory = new SikuliScriptProcessFactory(); processFactory.Start(processFactory.GetSikuliVersion()); }
public void ThrowsIfSikuliHomeIsSetAndFileDoesNotExist() { Environment.SetEnvironmentVariable("SIKULI_HOME", "%USERPROFILE%", EnvironmentVariableTarget.Process); var processFactory = new SikuliScriptProcessFactory(); var ex = Assert.Throws <NotSupportedException>(() => processFactory.Start(processFactory.GetSikuliVersion())); Assert.That(ex.Message.StartsWith("Could not find a known Sikuli version in SIKULI_HOME")); }
private static string RunProject(string projectPath, string args) { if (projectPath == null) { throw new ArgumentNullException(nameof(projectPath)); } if (!Directory.Exists(projectPath)) { throw new DirectoryNotFoundException($"Project not found in path '{projectPath}'"); } var processFactory = new SikuliScriptProcessFactory(); using (Process process = processFactory.Start($"-r {projectPath} {args}")) { process.WaitForExit(); string output = process.StandardOutput.ReadToEnd(); return(output); } }
public void CanGuessJavaPathWhenJavaHomeNotSet() { Environment.SetEnvironmentVariable("JAVA_HOME", null, EnvironmentVariableTarget.Process); Assert.That(SikuliScriptProcessFactory.GuessJavaPath(), Is.Not.Empty.Or.Null); }
public void CanGuessJavaPath() { Assert.That(SikuliScriptProcessFactory.GuessJavaPath(), Is.Not.Empty.Or.Null); }