示例#1
0
        public void CreatesAndDestroysTempFile()
        {
            var line = CommandLineGenerator.Generate("--file", "procedureExample.rcproc", "--procedure", "Test1", "--@a", "[1,2]", "--@b", "[3,4]", "--@key", "mykey");

            Assert.IsTrue(File.Exists(line.TemporaryFile));
            line.Dispose();
            Assert.IsFalse(File.Exists(line.TemporaryFile));
        }
示例#2
0
 public void GeneratesCommandLineForParameterlessProcedures()
 {
     using (var line = CommandLineGenerator.Generate("--file", "procedureExample.rcproc", "--procedure", "Test4"))
     {
         AssertMatch("^ --ldb  --eval \\\"[_\\:\\\\A-Za-z0-9]+\\.tmp\\\" , $", line.CliArguments);
         Assert.IsTrue(line.CliArguments.Contains(line.TemporaryFile));
     }
 }
示例#3
0
 public void GeneratesCommandLine2()
 {
     using (var line = CommandLineGenerator.Generate("--file", "procedureExample.rcproc", "--procedure", "Test2", "--@key1", "2", "--@somekeys", "[3,4]", "--@arg", "x", "--@someargv", "['hi this is', 'just, a test']"))
     {
         AssertMatch("^ --ldb  --eval \\\"[_\\:\\\\A-Za-z0-9]+\\.tmp\\\" \\\"2\\\" \\\"3\\\" \\\"4\\\" , \\\"2\\\" \\\"x\\\" \\\"2\\\" \\\"hi this is\\\" \\\"just, a test\\\" $", line.CliArguments);
         Assert.IsTrue(line.CliArguments.Contains(line.TemporaryFile));
     }
 }
示例#4
0
 public void GeneratesCommandLine()
 {
     using (var line = CommandLineGenerator.Generate("--file", "procedureExample.rcproc", "--procedure", "Test1", "--@a", "[1,2]", "--@b", "[3,4]", "--@key", "mykey"))
     {
         AssertMatch("^ --ldb  --eval \\\"[_\\:\\\\A-Za-z0-9]+\\.tmp\\\" \\\"mykey\\\" , \\\"2\\\" \\\"1\\\" \\\"2\\\" \\\"2\\\" \\\"3\\\" \\\"4\\\" $", line.CliArguments);
         Assert.IsTrue(line.CliArguments.Contains(line.TemporaryFile));
     }
 }
示例#5
0
 public void FailOnWrongFile()
 {
     var line = CommandLineGenerator.Generate("--file", "wrongFile.rcproc", "--procedure", "Test1", "--@b", "[3,4]", "--@key", "mykey");
 }
示例#6
0
 public void FailOnMissingParameters()
 {
     var line = CommandLineGenerator.Generate("--file", "procedureExample.rcproc", "--procedure", "Test1", "--@b", "[3,4]", "--@key", "mykey");
 }
示例#7
0
 public void FailOnNonExistentProcedure()
 {
     var line = CommandLineGenerator.Generate("--file", "procedureExample.rcproc", "--procedure", "Test3", "--@a", "[1,2]", "--@b", "[3,4]", "--@key", "mykey");
 }