예제 #1
0
        public void ParseTest1()
        {
            var target = new FileComponent(new Soba(), "");

            Assert.Throws <IncorrectSyntaxException>(() =>
                                                     target.Eval("#[File get(\"file\")]")
                                                     );

            Assert.Throws <IncorrectSyntaxException>(() =>
                                                     target.Eval("File get(\"file\")")
                                                     );
        }
예제 #2
0
        public void StCallParseTest1()
        {
            var target = new FileComponent(new Soba(), "");

            Assert.Throws <PMLevelException>(() =>
                                             target.Eval("[File call(file)]")
                                             );

            Assert.Throws <PMLevelException>(() =>
                                             target.Eval("[File out(file)]")
                                             );
        }
예제 #3
0
        public void StDeleteFilesTest1()
        {
            var target = new FileComponent(new Soba(), "");

            Assert.Throws <PMLevelException>(() =>
                                             target.Eval("[File delete.files(\"file\")]")
                                             );

            Assert.Throws <PMArgException>(() =>
                                           target.Eval("[File delete.files({\"file\", false})]")
                                           );

            Assert.Throws <PMArgException>(() =>
                                           target.Eval("[File delete.files({\"file\"}, {true})]")
                                           );
        }
예제 #4
0
        public void StRemoteTest2()
        {
            var target = new FileComponent(new Soba(), "");

            Assert.Throws <PMLevelException>(() =>
                                             target.Eval("[File remote.download()]")
                                             );

            Assert.Throws <PMLevelException>(() =>
                                             target.Eval("[File remote.download(\"addr\")]")
                                             );

            Assert.Throws <PMLevelException>(() =>
                                             target.Eval("[File remote.download(\"addr\", \"file\", \"user\")]")
                                             );
        }
예제 #5
0
        public void StDeleteTest1()
        {
            var target = new FileComponent(new Soba(), "");

            Assert.Throws <IncorrectNodeException>(() =>
                                                   target.Eval("[File delete]")
                                                   );

            Assert.Throws <IncorrectNodeException>(() =>
                                                   target.Eval("[File delete.files]")
                                                   );

            Assert.Throws <IncorrectNodeException>(() =>
                                                   target.Eval("[File delete.directory]")
                                                   );

            Assert.Throws <IncorrectNodeException>(() =>
                                                   target.Eval("[File delete.notRalNode]")
                                                   );
        }
예제 #6
0
        public void StCopyDirectoryTest1()
        {
            var target = new FileComponent(new Soba(), "");

            Assert.Throws <PMLevelException>(() =>
                                             target.Eval("[File copy.directory()]")
                                             );

            Assert.Throws <PMLevelException>(() =>
                                             target.Eval("[File copy.directory(false)]")
                                             );

            Assert.Throws <ArgumentException>(() =>
                                              target.Eval("[File copy.directory(\" \", \"dest\", false)]")
                                              );

            Assert.Throws <ArgumentException>(() =>
                                              target.Eval("[File copy.directory(\"src\", \" \", false)]")
                                              );
        }
예제 #7
0
        public void StCopyTest1()
        {
            var target = new FileComponent(new Soba(), "");

            Assert.Throws <IncorrectNodeException>(() =>
                                                   target.Eval("[File copy]")
                                                   );

            Assert.Throws <IncorrectNodeException>(() =>
                                                   target.Eval("[File copy.file]")
                                                   );

            Assert.Throws <IncorrectNodeException>(() =>
                                                   target.Eval("[File copy.directory]")
                                                   );

            Assert.Throws <IncorrectNodeException>(() =>
                                                   target.Eval("[File copy.notRalNode]")
                                                   );
        }
예제 #8
0
        public void StRemoteTest1()
        {
            var target = new FileComponent(new Soba(), "");

            Assert.Throws <IncorrectNodeException>(() =>
                                                   target.Eval("[File remote]")
                                                   );

            Assert.Throws <IncorrectNodeException>(() =>
                                                   target.Eval("[File remote.download]")
                                                   );

            Assert.Throws <IncorrectNodeException>(() =>
                                                   target.Eval("[File remote.notRealNode]")
                                                   );

            Assert.Throws <NotSupportedOperationException>(() =>
                                                           target.Eval("[File remote.download(\"addr\", \"file\").notRealNode]")
                                                           );
        }
예제 #9
0
        public void StWriteParseTest5()
        {
            var target = new FileComponent(new Soba(), "");

            Assert.Throws <PMLevelException>(() =>
                                             target.Eval("[File write(\"file\", true):data]")
                                             );

            Assert.Throws <PMLevelException>(() =>
                                             target.Eval("[File write(\"file\", true, true):data]")
                                             );

            Assert.Throws <PMLevelException>(() =>
                                             target.Eval("[File write(\"file\", \"true\", \"true\", \"utf-8\"):data]")
                                             );

            Assert.Throws <PMLevelException>(() =>
                                             target.Eval("[File append(\"file\", true, true, \"utf-8\"):data]")
                                             );

            Assert.Throws <PMLevelException>(() =>
                                             target.Eval("[File appendLine(\"file\", true, true, \"utf-8\"):data]")
                                             );

            Assert.Throws <PMLevelException>(() =>
                                             target.Eval("[File writeLine(\"file\", true, true, \"utf-8\"):data]")
                                             );
        }