예제 #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\")]"));
        }
예제 #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\")]"));
        }
예제 #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\")]"));
        }
예제 #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)]"));
        }
예제 #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 + "\")]"));
        }
예제 #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 + "\")]"));
        }
예제 #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)]"));
        }
예제 #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)]"));
        }
예제 #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\")]"));
        }
예제 #10
0
        public void stWriteParseTest1()
        {
            FileComponentAccessor target = new FileComponentAccessor();

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

            target.parse("[File call(\"file\", \"args\", )]");
        }
예제 #12
0
 public void stExistsParseTest1()
 {
     FileComponentAccessor target = new FileComponentAccessor();
     target.parse("[File exists.stub(\"path\")]");
 }
예제 #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]");
 }
예제 #16
0
        public void stReplaceParseTest1()
        {
            FileComponentAccessor target = new FileComponentAccessor();

            target.parse("[File replace(file, pattern, replacement)]");
        }
예제 #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 + "\")]"));
        }
예제 #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\")]"));
 }
예제 #19
0
 public void stReplaceParseTest1()
 {
     FileComponentAccessor target = new FileComponentAccessor();
     target.parse("[File replace(file, pattern, replacement)]");
 }
예제 #20
0
 public void stGetParseTest3()
 {
     FileComponentAccessor target = new FileComponentAccessor(true);
     target.parse("[File get(\"file\")]");
 }
예제 #21
0
 public void stGetParseTest2()
 {
     FileComponentAccessor target = new FileComponentAccessor();
     Assert.AreEqual("content from file", target.parse("[File get(\"file\")]"));
 }
예제 #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)]"));
        }
예제 #23
0
        public void stGetParseTest2()
        {
            FileComponentAccessor target = new FileComponentAccessor();

            Assert.AreEqual("content from file", target.parse("[File get(\"file\")]"));
        }
예제 #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)]");
 }
예제 #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\")]"));
 }
예제 #28
0
        public void stExistsParseTest1()
        {
            FileComponentAccessor target = new FileComponentAccessor();

            target.parse("[File exists.stub(\"path\")]");
        }
예제 #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\")]"));
 }
예제 #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\")]"));
 }
예제 #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)]"));
        }
예제 #32
0
 public void stWriteParseTest1()
 {
     FileComponentAccessor target = new FileComponentAccessor();
     target.parse("[File write(\"file\")]");
 }
예제 #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\")]"));
        }
예제 #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\")]");
 }