public void TestEcho() { const string echoMsg = "Echo back what is given as argument"; commandLine = new CommandLine("cmd", "/C echo " + echoMsg, workingDirectoryForSVNTests); var commandLineOutput = commandLine.Execute(); Assert.IsFalse(commandLineOutput.Failed, "Should not fail echo"); Assert.AreEqual(echoMsg, commandLineOutput.OutputStr.TrimEnd(), "Echo matches"); }
public void TestRepository() { commandLine = new CommandLine("svn", "status --xml -v", workingDirectoryForSVNTests); var commandLineOutput = commandLine.Execute(); Assert.Greater(commandLineOutput.OutputStr.Length, 0, "empty output"); D.Log(commandLineOutput.OutputStr); var statusDatabase = SVNStatusXMLParser.SVNParseStatusXML(commandLineOutput.OutputStr); Assert.IsNotEmpty(statusDatabase.Keys, "statusDatabase not empty"); }
public SyncCommandLineOperation(CommandLine command, CommandLine.ExecutionFinishedHandler finishHandler) : base(command, finishHandler) { }
public void TestErrorHandling() { commandLine = new CommandLine("svn", "", workingDirectoryForSVNTests); var commandLineOutput = commandLine.Execute(); Assert.AreEqual(1, commandLineOutput.Exitcode, "commandLineOutput.exitcode"); Assert.AreEqual("Type 'svn help' for usage.", commandLineOutput.ErrorStr.TrimEnd(), "commandLineOutput.errorStr"); Assert.IsTrue(commandLineOutput.Failed, "commandLineOut.failed"); }
protected CommandLineOperation(CommandLine command, CommandLine.ExecutionFinishedHandler finishHandler) { this.command = command; this.command.ExecutionFinished += finishHandler; }