Exemplo n.º 1
0
 /// <summary>
 /// Asserts that for the given command, the given arguments are considered valid
 /// on Windows, but invalid elsewhere.
 /// </summary>
 /// <param name="cmd">FsCommand to check</param>
 /// <param name="args">String... arguments to check</param>
 private static void AssertValidArgumentsOnWindows(FsCommand cmd, params string[]
                                                   args)
 {
     if (Org.Apache.Hadoop.Util.Shell.Windows)
     {
         cmd.Run(args);
     }
     else
     {
         AssertIllegalArguments(cmd, args);
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Asserts that for the given command, the given arguments are considered
 /// invalid.
 /// </summary>
 /// <remarks>
 /// Asserts that for the given command, the given arguments are considered
 /// invalid.  The expectation is that the command will throw
 /// IllegalArgumentException.
 /// </remarks>
 /// <param name="cmd">FsCommand to check</param>
 /// <param name="args">String... arguments to check</param>
 private static void AssertIllegalArguments(FsCommand cmd, params string[] args)
 {
     try
     {
         cmd.Run(args);
         NUnit.Framework.Assert.Fail("Expected IllegalArgumentException from args: " + Arrays
                                     .ToString(args));
     }
     catch (ArgumentException)
     {
     }
 }