亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? testemployeearray.java

?? SSD3 卡耐基梅隆大學教程 全部的參考答案啦`!不用賬號下載哦`
?? JAVA
字號:
import java.io.*;

/**
 * Tests the class <code>EmployeeArray</code>
 *
 * @author iCarnegie
 * @version 1.0.0
 * @see EmployeeArray
 * @see Employee
 */
public class  TestEmployeeArray  {

	/* Standard output stream */
	private static PrintWriter  stdOut =
		new  PrintWriter(System.out, true);

	/* Standard error stream */
	private static PrintWriter  stdErr =
		new  PrintWriter(System.err, true);

	/* Variables that contains the test objects */
	private Employee  first;
	private Employee  second;
	private Employee  third;
	private Employee  fourth;
	private Employee[]  empty;
	private Employee[]  array;
	private int nonEmployeeId;

	/**
	 * Tests methods of class {@link EmployeeArray}
	 *
	 * @param args  not used
	 */
	public static void main (String args[]) {

		stdOut.println("");
		stdOut.println("Testing class EmployeeArray...");

		TestEmployeeArray tester = new TestEmployeeArray();

		if (tester.testMakeArray() &
			tester.testCopyArray() &
			tester.testGetEmployee() &
			tester.testCountHigherSalaries() &
			tester.testSumSalaries() &
			tester.testGetHighestSalary() &
			tester.testIncreaseAll() &
			tester.testDisplayAll()) {
			stdOut.println("All tests passed");
		}
	}

	/**
	 * Displays a message in the standard error stream if the value specified
	 * by parameter <code>condition<code> is <code>false</code>.
	 *
	 * @param message  the error message.
	 * @param condition  the test condition.
	 * @return the value of <code>condition</code>
	 */
	public static boolean assertTrue(String message, boolean condition) {

		if (!condition) {
			stdErr.print("** Test failure ");
			stdErr.println(message);

			return false;
		} else {

			return true;
		}

	}

	/** Assign the initial value to the test variables */
	private void setUp() {

		first = new Employee(101, "First", 1000.0);
		second = new Employee(102, "Second", 100.0);
		third = new Employee(103, "Third", 1000.0);
		fourth = new Employee(104, "Fourth", 500.0);

		nonEmployeeId = 106;

		empty = new Employee[0];

		array = new Employee[4];
		array[0] = first;
		array[1] = second;
		array[2] = third;
		array[3] = fourth;
	}

	/**
	 * Tests the method <code>makeArray</code>.
	 *
	 * @return <code>true</code> if all test passed; otherwise returns
	 *         <code>false</code>.
	 */
	public boolean testMakeArray() {

		setUp();

		boolean test = true;

		Employee[] result =
			EmployeeArray.makeArray(first, second, third);

		test = test && assertTrue("1, testing method makeArray",
			result instanceof Employee[]);
		test = test && assertTrue("2, testing method makeArray",
			result.length == 3);
		test = test && assertTrue("3, testing method makeArray",
			result[0].equals(first));
		test = test && assertTrue("4, testing method makeArray",
			result[1].equals(second));
		test = test && assertTrue("5, testing method makeArray",
			result[2].equals(third));

		return test;
	}

	/**
	 * Tests the method <code>copyArray</code>.
	 *
	 * @return <code>true</code> if all test passed; otherwise returns
	 *         <code>false</code>.
	 */
	public boolean testCopyArray() {

		setUp();

		boolean test = true;

		Employee[]  resultEmpty = EmployeeArray.copyArray(empty);

		test = test && assertTrue("1, testing method copyArray",
			resultEmpty instanceof Employee[]);
		test = test && assertTrue("2, testing method copyArray",
			resultEmpty.length == 0);

		Employee resultArray[] = EmployeeArray.copyArray(array);

		test = test && assertTrue("3, testing method copyArray",
			resultArray instanceof Employee[]);
		test = test && assertTrue("4, testing method copyArray",
			resultArray.length == 4);
		test = test && assertTrue("5, testing method copyArray",
			resultArray[0] == first);
		test = test && assertTrue("6, testing method copyArray",
			resultArray[1] == second);
		test = test && assertTrue("7, testing method copyArray",
			resultArray[2] == third);
		test = test && assertTrue("8, testing method copyArray",
			resultArray[3] == fourth);

		return test;
	}

	/**
	 * Tests the method <code>getEmployee</code>.
	 *
	 * @return <code>true</code> if all test passed; otherwise returns
	 *         <code>false</code>.
	 */
	public boolean testGetEmployee() {

		setUp();

		boolean test = true;

		test = test && assertTrue("1, testing method getEmployee",
			EmployeeArray.getEmployee(empty, nonEmployeeId) == null);

		Employee employee;
		
		employee = EmployeeArray.getEmployee(array, first.getId());
		test = test && assertTrue("2, testing method getEmployee",
			employee !=null && employee.equals(first));
		employee = EmployeeArray.getEmployee(array, second.getId());
		test = test && assertTrue("3, testing method getEmployee",
			employee !=null && employee.equals(second));
		employee = EmployeeArray.getEmployee(array, third.getId());
		test = test && assertTrue("4, testing method getEmployee",
			employee !=null && employee.equals(third));
		employee = EmployeeArray.getEmployee(array, fourth.getId());
		test = test && assertTrue("5, testing method getEmployee",
			employee !=null && employee.equals(fourth));
		test = test && assertTrue("6, testing method getEmployee",
			EmployeeArray.getEmployee(array, nonEmployeeId) == null);

		return test;
	}

	/**
	 * Tests the method <code>countHigherSalaries</code>.
	 *
	 * @return <code>true</code> if all test passed; otherwise returns
	 *         <code>false</code>.
	 */
	public boolean testCountHigherSalaries() {

		setUp();

		boolean test = true;

		test = test && assertTrue("1, testing method countHigherSalaries",
			EmployeeArray.countHigherSalaries(empty, 0.0) == 0);

		test = test && assertTrue("2, testing method countHigherSalaries",
			EmployeeArray.countHigherSalaries(array, 0.0) == 4);
		test = test && assertTrue("3, testing method countHigherSalaries",
			EmployeeArray.countHigherSalaries(array, 100.0) == 3);
		test = test && assertTrue("4, testing method countHigherSalaries",
			EmployeeArray.countHigherSalaries(array, 100000.0) == 0);

		return test;
	}

	/**
	 * Tests the method <code>sumSalaries</code>
	 *
	 * @return <code>true</code> if all test passed; otherwise returns
	 *         <code>false</code>.
	 */
	public boolean testSumSalaries() {

		setUp();

		boolean test = true;

		test = test && assertTrue("1, testing method sumSalaries",
			EmployeeArray.sumSalaries(empty) == 0.0);
				
		test = test && assertTrue("2, testing method sumSalaries",
			EmployeeArray.sumSalaries(array) ==
				first.getSalary() + second.getSalary() +
				third.getSalary() + fourth.getSalary());

		return test;
	}

	/**
	 * Tests the method <code>getHighestSalary</code>
	 *
	 * @return <code>true</code> if test passed; otherwise returns
	 *         <code>false</code>.
	 */
	public boolean testGetHighestSalary() {

		setUp();

		boolean test = true;

		test = test && assertTrue(
			"1, testing method getHighestSalary",
			EmployeeArray.getHighestSalary(array) == 1000);

		Employee[] arrayTwo = new Employee[5];
		arrayTwo[0] = new Employee(101, "First", 2000.0);
		arrayTwo[1] = new Employee(102, "Second", 100.0);
		arrayTwo[2] = new Employee(103, "Third", 1000.0);
		arrayTwo[3] = new Employee(104, "Fourth", 500.0);
		arrayTwo[4] = new Employee(105, "Fifth",  500.0); 
		
		test = test && assertTrue(
			"2, testing method getHighestSalary",
			EmployeeArray.getHighestSalary(arrayTwo) == 2000);
		
		return test;
	}

	/**
	 * Tests the method <code>increaseAll</code>.
	 *
	 * @return <code>true</code> if all test passed; otherwise returns
	 *         <code>false</code>.
	 */
	public boolean testIncreaseAll() {

		setUp();

		boolean test = true;

		double amount = 100.0;
		double salaryFirst = first.getSalary();
		double salarySecond = second.getSalary();
		double salaryThird = third.getSalary();
		double salaryFourth = fourth.getSalary();
		
		EmployeeArray.increaseAll(array, amount);
		test = test && assertTrue("1, testing method increaseAll",
			first.getSalary() == salaryFirst + amount);
		test = test && assertTrue("2, testing method increaseAll",
			second.getSalary() == salarySecond + amount);
		test = test && assertTrue("3, testing method increaseAll",
			third.getSalary() == salaryThird + amount);
		test = test && assertTrue("4, testing method increaseAll",
			fourth.getSalary() == salaryFourth + amount);

		return test;
	}

	/**
	 * Tests the method <code>displayAll</code>.
	 *
	 * @return <code>true</code> if all test passed; otherwise returns
	 *         <code>false</code>.
	 */
	public boolean testDisplayAll() {

		setUp();

		boolean test = true;
		
		test = test && assertTrue("1, testing method displayAll",
			EmployeeArray.displayAll(empty).equals(""));

		String result = EmployeeArray.displayAll(array);
		
		test = test && assertTrue("2, testing method displayAll",
			EmployeeArray.displayAll(array).equals(
				first.toString() + "\n" + second.toString() + "\n" +
				third.toString() + "\n" + fourth.toString()));

		return test;
	}
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
5858s免费视频成人| 中文字幕在线播放不卡一区| 成人av电影在线网| 激情国产一区二区| 日本不卡1234视频| 男男视频亚洲欧美| av在线不卡观看免费观看| 国产乱码精品一区二区三区av | 国产精品成人免费| 中文字幕乱码亚洲精品一区| 精品成人佐山爱一区二区| 91精品国产一区二区人妖| 8x福利精品第一导航| 六月丁香婷婷久久| 久久99精品久久久久久久久久久久 | 国产精品色哟哟| 亚洲国产精品av| 日本不卡一二三| 色婷婷综合视频在线观看| 91美女视频网站| 在线欧美小视频| 6080日韩午夜伦伦午夜伦| 亚洲欧美日韩电影| 亚欧色一区w666天堂| 美女网站色91| 成人免费视频免费观看| 91福利国产精品| 日韩欧美国产综合| 亚洲欧洲日产国码二区| 国产一区久久久| 99riav一区二区三区| 欧美日韩视频专区在线播放| 日韩精品中文字幕在线一区| 亚洲国产日韩一区二区| 国产麻豆视频一区| 欧美xxxx老人做受| 亚洲香肠在线观看| 色综合久久久久网| 亚洲欧美综合另类在线卡通| 岛国精品在线播放| 亚洲欧洲精品一区二区精品久久久| 国产精品自拍av| 欧美一级片免费看| 国产一区福利在线| 国产欧美日韩一区二区三区在线观看| 亚洲精品日韩一| 国产一区二区精品久久| 久久综合视频网| 调教+趴+乳夹+国产+精品| fc2成人免费人成在线观看播放| 国产网站一区二区三区| 日韩在线播放一区二区| 91浏览器打开| 亚洲综合网站在线观看| va亚洲va日韩不卡在线观看| 亚洲欧洲精品成人久久奇米网| 不卡欧美aaaaa| 亚洲午夜视频在线| 9191成人精品久久| 日本成人中文字幕| 欧美日韩免费高清一区色橹橹| 欧美一区二区三区四区五区| 另类综合日韩欧美亚洲| 国产欧美日本一区二区三区| 91网站最新地址| 亚洲午夜影视影院在线观看| 日韩视频一区二区| 青青草国产精品97视觉盛宴| 26uuu国产在线精品一区二区| 国产成人小视频| 国产日韩欧美精品在线| 99久久er热在这里只有精品66| 夜夜操天天操亚洲| 91首页免费视频| 石原莉奈在线亚洲三区| 久久久久久免费| 国产久卡久卡久卡久卡视频精品| 国产女同性恋一区二区| 在线一区二区三区做爰视频网站| 天堂久久久久va久久久久| 久久伊人蜜桃av一区二区| 在线看不卡av| 国产麻豆视频精品| 亚洲国产中文字幕在线视频综合| 精品国产免费一区二区三区四区| 99r精品视频| 激情综合网av| 亚洲h在线观看| 国产精品麻豆网站| 久久男人中文字幕资源站| 欧美性大战久久久久久久 | 亚洲高清在线视频| 国产精品视频yy9299一区| 91精品国产全国免费观看| 91亚洲精品一区二区乱码| 久久不见久久见免费视频7| 亚洲区小说区图片区qvod| 日韩欧美中文字幕一区| 99国产精品久久久| 天天做天天摸天天爽国产一区 | 欧美日韩视频专区在线播放| 国产成人精品免费视频网站| 亚洲一级二级在线| 日韩一区二区免费电影| 成人免费黄色大片| 日韩电影在线免费观看| 久久久久久麻豆| 精品国产99国产精品| 欧美午夜在线观看| 福利一区在线观看| 一区在线播放视频| 日韩视频一区二区| 欧美色综合网站| 色婷婷综合久久| 成人av电影在线网| 国产福利不卡视频| 免费观看在线综合色| 亚洲最新视频在线播放| 国产精品美日韩| 久久久久久久一区| 91精品国产全国免费观看| 欧美美女视频在线观看| 捆绑调教美女网站视频一区| 一区二区三区久久久| 亚洲私人影院在线观看| 欧美人狂配大交3d怪物一区| 99精品视频一区二区三区| 波多野结衣欧美| 国产成人综合亚洲91猫咪| 久久精品99国产精品日本| 视频一区二区三区入口| 亚洲第一福利一区| 亚洲黄色在线视频| 亚洲国产美国国产综合一区二区| 最新国产の精品合集bt伙计| 国产欧美日韩视频一区二区| 国产欧美日本一区二区三区| 国产精品免费久久久久| 国产亚洲一区二区三区| 国产三级精品三级在线专区| 国产日韩v精品一区二区| 国产亚洲成年网址在线观看| 国产清纯在线一区二区www| 精品少妇一区二区| 国产午夜精品一区二区三区四区| 欧美日韩国产中文| 69堂精品视频| 精品区一区二区| 久久久欧美精品sm网站| 国产精品区一区二区三区 | 狠狠色丁香久久婷婷综合_中| 久久se这里有精品| 国产一区二区中文字幕| 成人sese在线| 91麻豆高清视频| 91成人免费在线视频| 成人免费看黄yyy456| 欧美性猛交xxxxxx富婆| 欧美一区二区三区在线电影| 欧美一级高清大全免费观看| 欧美第一区第二区| 国产亚洲综合av| 午夜电影网一区| 岛国一区二区在线观看| 成人免费看视频| 日韩视频一区二区三区| 欧美国产1区2区| 一区二区三区四区五区视频在线观看 | 中文字幕第一区二区| 亚洲乱码国产乱码精品精小说 | 日本中文字幕一区| 粉嫩在线一区二区三区视频| 91福利在线播放| 日韩欧美另类在线| 自拍偷拍亚洲综合| 久久99精品久久只有精品| 91小宝寻花一区二区三区| 久久新电视剧免费观看| 亚洲精选一二三| 国产一区免费电影| 色女孩综合影院| 欧美一级夜夜爽| 一个色在线综合| 国内精品国产成人国产三级粉色| av中文一区二区三区| 精品国产99国产精品| 亚洲丶国产丶欧美一区二区三区| 精品一二三四区| 欧美日韩一区精品| 国产精品久久久久久久蜜臀| 日韩精品电影在线| 91成人免费在线| 国产精品久久网站| 精品在线播放午夜| 欧美另类高清zo欧美| 亚洲另类在线视频| 99久久久久久99| 国产日韩精品一区| 国产高清视频一区| 91麻豆精品国产自产在线观看一区|