public void stDeleteTest1() { var target = new FileComponent(); try { target.parse("[File delete]"); Assert.Fail("1"); } catch (Exception ex) { Assert.IsTrue(ex.GetType() == typeof(IncorrectNodeException), ex.GetType().ToString()); } try { target.parse("[File delete.files]"); Assert.Fail("2"); } catch (Exception ex) { Assert.IsTrue(ex.GetType() == typeof(IncorrectNodeException), ex.GetType().ToString()); } try { target.parse("[File delete.directory]"); Assert.Fail("3"); } catch (Exception ex) { Assert.IsTrue(ex.GetType() == typeof(IncorrectNodeException), ex.GetType().ToString()); } try { target.parse("[File delete.notRalNode]"); Assert.Fail("4"); } catch (Exception ex) { Assert.IsTrue(ex.GetType() == typeof(IncorrectNodeException), ex.GetType().ToString()); } }
public void stDeleteFilesTest1() { var target = new FileComponent(); try { target.parse("[File delete.files(\"file\")]"); Assert.Fail("1"); } catch (Exception ex) { Assert.IsTrue(ex.GetType() == typeof(ArgumentPMException)); } try { target.parse("[File delete.files({\"file\", false})]"); Assert.Fail("2"); } catch (Exception ex) { Assert.IsTrue(ex.GetType() == typeof(InvalidArgumentException)); } try { target.parse("[File delete.files({\"file\"}, {true})]"); Assert.Fail("3"); } catch (Exception ex) { Assert.IsTrue(ex.GetType() == typeof(InvalidArgumentException)); } }
public void stCopyDirectoryTest1() { var target = new FileComponent(); try { target.parse("[File copy.directory()]"); Assert.Fail("1"); } catch (Exception ex) { Assert.IsTrue(ex.GetType() == typeof(ArgumentPMException), ex.GetType().ToString()); } try { target.parse("[File copy.directory(false)]"); Assert.Fail("2"); } catch (Exception ex) { Assert.IsTrue(ex.GetType() == typeof(ArgumentPMException), ex.GetType().ToString()); } try { target.parse("[File copy.directory(\" \", \"dest\", false)]"); Assert.Fail("3"); } catch (Exception ex) { Assert.IsTrue(ex.GetType() == typeof(InvalidArgumentException), ex.GetType().ToString()); } try { target.parse("[File copy.directory(\"src\", \" \", false)]"); Assert.Fail("4"); } catch (Exception ex) { Assert.IsTrue(ex.GetType() == typeof(InvalidArgumentException), ex.GetType().ToString()); } }
public void stRemoteTest1() { var target = new FileComponent(); try { target.parse("[File remote]"); Assert.Fail("1"); } catch (Exception ex) { Assert.IsTrue(ex.GetType() == typeof(IncorrectNodeException), ex.GetType().ToString()); } try { target.parse("[File remote.download]"); Assert.Fail("2"); } catch (Exception ex) { Assert.IsTrue(ex.GetType() == typeof(IncorrectNodeException), ex.GetType().ToString()); } try { target.parse("[File remote.notRealNode]"); Assert.Fail("3"); } catch (Exception ex) { Assert.IsTrue(ex.GetType() == typeof(IncorrectNodeException), ex.GetType().ToString()); } try { target.parse("[File remote.download(\"addr\", \"file\").notRealNode]"); Assert.Fail("4"); } catch (Exception ex) { Assert.IsTrue(ex.GetType() == typeof(NotSupportedOperationException), ex.GetType().ToString()); } }
public void stCallParseTest1() { var target = new FileComponent(); try { target.parse("[File call(file)]"); Assert.Fail("1"); } catch (Exception ex) { Assert.IsTrue(ex.GetType() == typeof(ArgumentPMException), ex.GetType().ToString()); } try { target.parse("[File out(file)]"); Assert.Fail("2"); } catch (Exception ex) { Assert.IsTrue(ex.GetType() == typeof(ArgumentPMException), ex.GetType().ToString()); } }
public void stRemoteTest2() { var target = new FileComponent(); try { target.parse("[File remote.download()]"); Assert.Fail("1"); } catch (Exception ex) { Assert.IsTrue(ex.GetType() == typeof(ArgumentPMException), ex.GetType().ToString()); } try { target.parse("[File remote.download(\"addr\")]"); Assert.Fail("2"); } catch (Exception ex) { Assert.IsTrue(ex.GetType() == typeof(ArgumentPMException), ex.GetType().ToString()); } try { target.parse("[File remote.download(\"addr\", \"file\", \"user\")]"); Assert.Fail("3"); } catch (Exception ex) { Assert.IsTrue(ex.GetType() == typeof(ArgumentPMException), ex.GetType().ToString()); } }
public void stWriteParseTest5() { var target = new FileComponent(); try { target.parse("[File write(\"file\", true):data]"); Assert.Fail("1"); } catch (Exception ex) { Assert.IsTrue(ex.GetType() == typeof(ArgumentPMException), ex.GetType().ToString()); } try { target.parse("[File write(\"file\", true, true):data]"); Assert.Fail("2"); } catch (Exception ex) { Assert.IsTrue(ex.GetType() == typeof(ArgumentPMException), ex.GetType().ToString()); } try { target.parse("[File write(\"file\", \"true\", \"true\", \"utf-8\"):data]"); Assert.Fail("3"); } catch (Exception ex) { Assert.IsTrue(ex.GetType() == typeof(ArgumentPMException), ex.GetType().ToString()); } try { target.parse("[File append(\"file\", true, true, \"utf-8\"):data]"); Assert.Fail("4"); } catch (Exception ex) { Assert.IsTrue(ex.GetType() == typeof(ArgumentPMException), ex.GetType().ToString()); } try { target.parse("[File appendLine(\"file\", true, true, \"utf-8\"):data]"); Assert.Fail("5"); } catch (Exception ex) { Assert.IsTrue(ex.GetType() == typeof(ArgumentPMException), ex.GetType().ToString()); } try { target.parse("[File writeLine(\"file\", true, true, \"utf-8\"):data]"); Assert.Fail("6"); } catch (Exception ex) { Assert.IsTrue(ex.GetType() == typeof(ArgumentPMException), ex.GetType().ToString()); } }
public void stGetParseTest1() { FileComponent target = new FileComponent(); target.parse("[File get(file)]"); }
public void parseTest2() { FileComponent target = new FileComponent(); target.parse("File get(\"file\")"); }