Esempio n. 1
0
    public void TestHelpOutput()
    {
      iModule mod = new BashModule ();

      mod.run ("help", new string[0]);

      // The return code may indicate
      // the tests are not being run in an environment
      // with bash (Windows, some distros).
      if (mod.resultCode() != 2) {
        // Light check just to ensure some related output came back.
        Assert.AreEqual (mod.standardOutput ().Contains ("help"), true);
      }
    }
Esempio n. 2
0
        public void TestHelpOutput()
        {
            iModule mod = new BashModule();

            mod.run("help", new string[0]);

            // The return code may indicate
            // the tests are not being run in an environment
            // with bash (Windows, some distros).
            if (mod.resultCode() != 2)
            {
                // Light check just to ensure some related output came back.
                Assert.AreEqual(mod.standardOutput().Contains("help"), true);
            }
        }
Esempio n. 3
0
        public void TestMkDirAndRM()
        {
            // Cleanup
            if (Directory.Exists(testDir))
            {
                Directory.Delete(testDir);
            }

            iModule mod = new BashModule();

            string[] args = new string[1];
            args [0] = testDir;

            mod.run("mkdir", args);

            // The return code may indicate
            // the tests are not being run in an environment
            // with bash (Windows, some distros).
            if (mod.resultCode() != 2)
            {
                // Check the directory exists indicating success
                // Double check the return code is the expected 0
                Assert.AreEqual(Directory.Exists(testDir), true);
                Assert.AreEqual(mod.resultCode(), 0);
            }

            args     = new string[2];
            args [0] = "-rf";
            args [1] = testDir;

            mod.run("rm", args);

            // The return code may indicate
            // the tests are not being run in an environment
            // with bash (Windows, some distros).
            if (mod.resultCode() != 2)
            {
                // Check the directory no longer exists indicating success
                // Double check the return code is the expected 0
                Assert.AreEqual(Directory.Exists(testDir), false);
                Assert.AreEqual(mod.resultCode(), 0);
            }
            #endregion
        }
Esempio n. 4
0
    public void TestMkDirAndRM()
    {
      // Cleanup
      if (Directory.Exists (testDir))
        Directory.Delete (testDir);

      iModule mod = new BashModule ();
     
      string[] args = new string[1];
      args [0] = testDir;

      mod.run ("mkdir", args);

      // The return code may indicate
      // the tests are not being run in an environment
      // with bash (Windows, some distros).
      if (mod.resultCode() != 2) {
        // Check the directory exists indicating success
        // Double check the return code is the expected 0
        Assert.AreEqual (Directory.Exists (testDir), true);
        Assert.AreEqual (mod.resultCode (), 0);
      }

      args = new string[2];
      args [0] = "-rf";
      args [1] = testDir;

      mod.run ("rm", args);

      // The return code may indicate
      // the tests are not being run in an environment
      // with bash (Windows, some distros).
      if (mod.resultCode() != 2) {
        // Check the directory no longer exists indicating success
        // Double check the return code is the expected 0
        Assert.AreEqual (Directory.Exists (testDir), false);
        Assert.AreEqual (mod.resultCode(), 0);
      }
      #endregion
    }