Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Use JUnit CN
Revision as of 02:31, 3 October 2006 by Young.yz.gmail.com (Talk | contribs)
本文论述如何在Eclipse 中使用JUnit 进行单元测试。
Contents
基本概念
- TestRunner
- TestCase
- TestSuite
使用说明
- 新建sample 项目,源文件夹为src。
- 新建Triangle 类,包名为com.ime.sample。
- 新建源文件夹test。
- 新建TriangleTest 类,包名为com.ime.sample.test。
- 使用JUnit 运行TriangleTest。
- 重构TriangleTest 和Triangle 类。