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

📄 taxitest.java

📁 现在在国外大学里最流行的java学习软件,同时还有大量的example,在名为project的文件里.安装好后用bluej打开peoject的例子,可以进行你想要的任何变化.同时可以了解大量的源码
💻 JAVA
字号:
/** * The test class TaxiTest. * * @author  (your name) * @version (a version number or a date) */public class TaxiTest extends junit.framework.TestCase{    private Taxi taxi;        /**     * Default constructor for test class TaxiTest     */    public TaxiTest()    {    }    /**     * Create a taxi.     *     * Called before every test case method.     */    protected void setUp()    {        TaxiCompany company = new TaxiCompany();        Location taxiLocation = new Location();        taxi = new Taxi(company, taxiLocation);    }    /**     * Tears down the test fixture.     *     * Called after every test case method.     */    protected void tearDown()    {    }        /**     * Test creation and the initial state of a taxi.     */    public void testCreation()    {        assertEquals(true, taxi.isFree());    }        /**     * Test that a taxi is no longer free after it has     * picked up a passenger.     */    public void testPickup()    {        Location pickup = new Location();        Location destination = new Location();        Passenger passenger = new Passenger(pickup, destination);        taxi.pickup(passenger);        assertEquals(false, taxi.isFree());    }        /**     * Test that a taxi becomes free again after offloading     * a passenger.     */    public void testOffload()    {        testPickup();        taxi.offloadPassenger();        assertEquals(true, taxi.isFree());    }}

⌨️ 快捷键说明

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