/*
* checkArgumentsTest.java
* JUnit based test
*
* Created on 8 novembre 2004, 11:22
*/
package test;
import reservation.system.functions.Functions;
import java.util.Vector;
import java.util.ListIterator;
import java.util.LinkedList;
import java.util.Collection;
import java.util.HashSet;
import java.util.Set;
import junit.framework.*;
/**
*
* @author mathieu
*/
public class checkArgumentsTest extends TestCase {
public checkArgumentsTest
(java.
lang.
String testName
) {
super (testName);
}
public static Test suite () {
TestSuite suite = new TestSuite (checkArgumentsTest.class);
return suite;
}
/**
* Test of validityArgument method, of class FlightSystem.checkArguments.
*/
public void testArgumentisValid () {
System.
out.
println ("testArgumentIsValid");
try {
Functions.
ArgumentIsValid (new String[]{"Adam",
"Caroline"},
0,
0);
fail ("Illegal number of argument");
} catch (Exception e
) {System.
out.
println (errorString
+ " OK :" + e.
getMessage ());}
try {
Functions.
ArgumentIsValid (new String[]{null},
0,
0);
fail ("Illegal number of argument and argument null");
} catch (Exception e
) {System.
out.
println (errorString
+ " OK :" + e.
getMessage ());}
try {
Functions.
ArgumentIsValid (new String[]{"Adam",
"Caroline"},
2,
0);
fail ("The max must be superior to the min.");
} catch (Exception e
) {System.
out.
println (errorString
+ " OK :" + e.
getMessage ());}
}
}