checkargumentstest.java

来自「This project developed in java leads us 」· Java 代码 · 共 56 行

JAVA
56
字号
/* * 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");        String errorString = "Error";        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 ());}    }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?