Beispiel #1
0
        public void stWriteParseTest3()
        {
            FileComponentAccessor target = new FileComponentAccessor();

            target.parse("[File write(\"file\"): multi\nline\" \n 'data'.]");
            Assert.AreEqual(" multi\nline\" \n 'data'.", target.parse("[File get(\"file\")]"));
        }
Beispiel #2
0
        public void stReplaceParseTest4()
        {
            FileComponentAccessor target = new FileComponentAccessor();

            target.parse("[File replace.Wildcards(\"file\", \"con*from \", \"\")]");
            Assert.AreEqual("file", target.parse("[File get(\"file\")]"));
        }
Beispiel #3
0
        public void stReplaceParseTest5()
        {
            FileComponentAccessor target = new FileComponentAccessor();

            target.parse("[File replace.Regex(\"file\", \"t\\s*from\", \"t to\")]");
            Assert.AreEqual("content to file", target.parse("[File get(\"file\")]"));
        }
Beispiel #4
0
        public void stCallParseTest7()
        {
            FileComponentAccessor target = new FileComponentAccessor();

            Assert.AreEqual("stdout", target.parse("[File call(\"file\", \"args\", 0)]"));
            Assert.AreEqual("silent stdout", target.parse("[File scall(\"file\", \"args\", 15)]"));
            Assert.AreEqual("silent stdout", target.parse("[File sout(\"file\", \"args\", 10)]"));
        }
Beispiel #5
0
        public void stExistsParseTest2()
        {
            FileComponentAccessor target = new FileComponentAccessor();
            string realDir = Path.GetDirectoryName(Assembly.GetAssembly(GetType()).Location);

            Assert.AreEqual(Value.VFALSE, target.parse("[File exists.directory(\"c:\\stubdir\\notexist\")]"));
            Assert.AreEqual(Value.VTRUE, target.parse("[File exists.directory(\"" + realDir + "\")]"));
        }
Beispiel #6
0
        public void stExistsParseTest4()
        {
            FileComponentAccessor target = new FileComponentAccessor();
            string realFile = Assembly.GetAssembly(GetType()).Location;

            Assert.AreEqual(Value.VFALSE, target.parse("[File exists.file(\"file\")]"));
            Assert.AreEqual(Value.VTRUE, target.parse("[File exists.file(\"" + realFile + "\")]"));
        }
Beispiel #7
0
        public void stExistsParseTest3()
        {
            FileComponentAccessor target = new FileComponentAccessor();

            Assert.AreEqual(Value.VFALSE, target.parse("[File exists.directory(\"System32\", false)]"));
            //Assert.AreEqual(Value.VFALSE, target.parse("[File exists.directory(\"" + realDir + "\", true)]"));
            Assert.AreEqual(Value.VTRUE, target.parse("[File exists.directory(\"System32\", true)]"));
        }
Beispiel #8
0
        public void stExistsParseTest5()
        {
            FileComponentAccessor target = new FileComponentAccessor();
            string realFile = Path.GetFileName(Assembly.GetAssembly(GetType()).Location);

            Assert.AreEqual(Value.VFALSE, target.parse("[File exists.file(\"cmd.exe\", false)]"));
            //Assert.AreEqual(Value.VFALSE, target.parse("[File exists.file(\"" + realFile + "\", true)]"));
            Assert.AreEqual(Value.VTRUE, target.parse("[File exists.file(\"cmd.exe\", true)]"));
        }
Beispiel #9
0
        public void stWriteParseTest2()
        {
            FileComponentAccessor target = new FileComponentAccessor();

            target.parse("[File write(\"file\"):data]");
            Assert.AreEqual("data", target.parse("[File get(\"file\")]"));

            // append, writeLine, appendLine is identical for current accessor
            // however, also need checking the entry point as for the write() above:

            target.parse("[File append(\"file\"):data]");
            Assert.AreEqual("data", target.parse("[File get(\"file\")]"));
            target.parse("[File writeLine(\"file\"):data]");
            Assert.AreEqual("data", target.parse("[File get(\"file\")]"));
            target.parse("[File appendLine(\"file\"):data]");
            Assert.AreEqual("data", target.parse("[File get(\"file\")]"));
        }
Beispiel #10
0
        public void stWriteParseTest1()
        {
            FileComponentAccessor target = new FileComponentAccessor();

            target.parse("[File write(\"file\")]");
        }
Beispiel #11
0
        public void stCallParseTest8()
        {
            FileComponentAccessor target = new FileComponentAccessor();

            target.parse("[File call(\"file\", \"args\", )]");
        }
Beispiel #12
0
 public void stExistsParseTest1()
 {
     FileComponentAccessor target = new FileComponentAccessor();
     target.parse("[File exists.stub(\"path\")]");
 }
Beispiel #13
0
        public void stExistsParseTest4()
        {
            FileComponentAccessor target = new FileComponentAccessor();
            string realFile = Assembly.GetAssembly(GetType()).Location;

            Assert.AreEqual(Value.VFALSE, target.parse("[File exists.file(\"file\")]"));
            Assert.AreEqual(Value.VTRUE, target.parse("[File exists.file(\"" + realFile + "\")]"));
        }
 public void stWriteParseTest7()
 {
     FileComponentAccessor target = new FileComponentAccessor();
     target.parse("[File write(\"file\", \"true\", \"true\", \"utf-8\"):data]");
 }
 public void stWriteParseTest9()
 {
     FileComponentAccessor target = new FileComponentAccessor();
     target.parse("[File appendLine(\"file\", true, true, \"utf-8\"):data]");
 }
Beispiel #16
0
        public void stReplaceParseTest1()
        {
            FileComponentAccessor target = new FileComponentAccessor();

            target.parse("[File replace(file, pattern, replacement)]");
        }
Beispiel #17
0
        public void stExistsParseTest2()
        {
            FileComponentAccessor target = new FileComponentAccessor();
            string realDir = Path.GetDirectoryName(Assembly.GetAssembly(GetType()).Location);

            Assert.AreEqual(Value.VFALSE, target.parse("[File exists.directory(\"c:\\stubdir\\notexist\")]"));
            Assert.AreEqual(Value.VTRUE, target.parse("[File exists.directory(\"" + realDir + "\")]"));
        }
Beispiel #18
0
 public void stReplaceParseTest4()
 {
     FileComponentAccessor target = new FileComponentAccessor();
     target.parse("[File replace.Wildcards(\"file\", \"con*from \", \"\")]");
     Assert.AreEqual("file", target.parse("[File get(\"file\")]"));
 }
Beispiel #19
0
 public void stReplaceParseTest1()
 {
     FileComponentAccessor target = new FileComponentAccessor();
     target.parse("[File replace(file, pattern, replacement)]");
 }
Beispiel #20
0
 public void stGetParseTest3()
 {
     FileComponentAccessor target = new FileComponentAccessor(true);
     target.parse("[File get(\"file\")]");
 }
Beispiel #21
0
 public void stGetParseTest2()
 {
     FileComponentAccessor target = new FileComponentAccessor();
     Assert.AreEqual("content from file", target.parse("[File get(\"file\")]"));
 }
Beispiel #22
0
        public void stExistsParseTest5()
        {
            FileComponentAccessor target = new FileComponentAccessor();
            string realFile = Path.GetFileName(Assembly.GetAssembly(GetType()).Location);

            Assert.AreEqual(Value.VFALSE, target.parse("[File exists.file(\"cmd.exe\", false)]"));
            //Assert.AreEqual(Value.VFALSE, target.parse("[File exists.file(\"" + realFile + "\", true)]"));
            Assert.AreEqual(Value.VTRUE, target.parse("[File exists.file(\"cmd.exe\", true)]"));
        }
Beispiel #23
0
        public void stGetParseTest2()
        {
            FileComponentAccessor target = new FileComponentAccessor();

            Assert.AreEqual("content from file", target.parse("[File get(\"file\")]"));
        }
Beispiel #24
0
 public void stCallParseTest8()
 {
     FileComponentAccessor target = new FileComponentAccessor();
     target.parse("[File call(\"file\", \"args\", )]");
 }
 public void stWriteParseTest6()
 {
     FileComponentAccessor target = new FileComponentAccessor();
     target.parse("[File write(\"file\", true, true):data]");
 }
 public void stCallParseTest2()
 {
     FileComponentAccessor target = new FileComponentAccessor();
     target.parse("[File out(file)]");
 }
Beispiel #27
0
 public void stWriteParseTest3()
 {
     FileComponentAccessor target = new FileComponentAccessor();
     target.parse("[File write(\"file\"): multi\nline\" \n 'data'.]");
     Assert.AreEqual(" multi\nline\" \n 'data'.", target.parse("[File get(\"file\")]"));
 }
Beispiel #28
0
        public void stExistsParseTest1()
        {
            FileComponentAccessor target = new FileComponentAccessor();

            target.parse("[File exists.stub(\"path\")]");
        }
Beispiel #29
0
 public void stCallParseTest3()
 {
     FileComponentAccessor target = new FileComponentAccessor();
     Assert.AreEqual("stdout", target.parse("[File call(\"file\")]"));
     Assert.AreEqual("stdout", target.parse("[File call(\"file\", \"args\")]"));
     Assert.AreEqual("silent stdout", target.parse("[File scall(\"file\")]"));
     Assert.AreEqual("silent stdout", target.parse("[File scall(\"file\", \"args\")]"));
     Assert.AreEqual("silent stdout", target.parse("[File sout(\"file\")]"));
     Assert.AreEqual("silent stdout", target.parse("[File sout(\"file\", \"args\")]"));
 }
Beispiel #30
0
 public void stReplaceParseTest5()
 {
     FileComponentAccessor target = new FileComponentAccessor();
     target.parse("[File replace.Regex(\"file\", \"t\\s*from\", \"t to\")]");
     Assert.AreEqual("content to file", target.parse("[File get(\"file\")]"));
 }
Beispiel #31
0
        public void stExistsParseTest3()
        {
            FileComponentAccessor target = new FileComponentAccessor();

            Assert.AreEqual(Value.VFALSE, target.parse("[File exists.directory(\"System32\", false)]"));
            //Assert.AreEqual(Value.VFALSE, target.parse("[File exists.directory(\"" + realDir + "\", true)]"));
            Assert.AreEqual(Value.VTRUE, target.parse("[File exists.directory(\"System32\", true)]"));
        }
Beispiel #32
0
 public void stWriteParseTest1()
 {
     FileComponentAccessor target = new FileComponentAccessor();
     target.parse("[File write(\"file\")]");
 }
Beispiel #33
0
        public void stWriteParseTest2()
        {
            FileComponentAccessor target = new FileComponentAccessor();
            target.parse("[File write(\"file\"):data]");
            Assert.AreEqual("data", target.parse("[File get(\"file\")]"));

            // append, writeLine, appendLine is identical for current accessor
            // however, also need checking the entry point as for the write() above:

            target.parse("[File append(\"file\"):data]");
            Assert.AreEqual("data", target.parse("[File get(\"file\")]"));
            target.parse("[File writeLine(\"file\"):data]");
            Assert.AreEqual("data", target.parse("[File get(\"file\")]"));
            target.parse("[File appendLine(\"file\"):data]");
            Assert.AreEqual("data", target.parse("[File get(\"file\")]"));
        }
Beispiel #34
0
        public void stGetParseTest3()
        {
            FileComponentAccessor target = new FileComponentAccessor(true);

            target.parse("[File get(\"file\")]");
        }
 public void stCallParseTest4()
 {
     FileComponentAccessor target = new FileComponentAccessor(true);
     target.parse("[File call(\"file\")]");
 }