⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 test2_doctors.java

📁 A system to manage patients of an hospital (using Inheritance, Exceptions and Collections).
💻 JAVA
字号:
import junit.framework.TestCase;import hospital.*;public class Test2_Doctors extends TestCase{		public Test2_Doctors(String arg0) {		super(arg0);	}		Hospital h;    int docID;    String first;    String last;		protected void setUp() {	    h = new Hospital();	    docID = 5;	    first = "Mario";	    last = "White";	    h.addDoctor(first, last, docID);	}	public void testAdd() throws NoSuchDoctor {		Person d = h.getDoctor(docID);		assertEquals(first, d.getFirst());		assertEquals(last, d.getLast());	}	public void testNotFound() {		h.addDoctor(first, last, docID);		try {			Person d = h.getDoctor(docID+100);			assertEquals(d, null);		} catch (NoSuchDoctor e) {			assertTrue(true);		}	}	public void testInsertTwice() throws NoSuchDoctor {		h.addDoctor(first+"X", last+"Y", docID);		h.addDoctor(first, last, docID);		Person p = h.getDoctor(docID);		assertEquals(last, p.getLast());	}}

⌨️ 快捷键说明

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