JUNIT在线API以及 assertTrue(boolean condition),assertTrue(String message, boolean condition)
2012-05-14 14:23
375 查看
http://kentbeck.github.com/junit/javadoc/latest/
补充:
可以提示错误:
代码如下:
补充:
static void | assertTrue(String message, boolean condition) Asserts that a condition is true. |
代码如下:
package com.zzk.junit4.test; import static org.junit.Assert.*;//这是一个类不是包 import org.junit.After; import org.junit.Test; import com.zzk.junit4.T; public class TTest { @After public void tearDown() throws Exception { } @Test public void testAdd() { //fail("Not yet implemented"); int z = new T().add(5, 3); assertEquals(8, z);//期望值8,实际值z assertTrue(z>3); // assertTrue("z is too small",z>10); } }
相关文章推荐
- JUnit【1】断言用法之assertEquals/True/False/ArrayEquals
- 为什么org.junit.Assert.assertTrue要静态导入
- JUnit单元测试举例(@Test,@Before,@After,@beforeClass,@afterClass,assertEquals,assertTrue等)
- junit 方法:assertEquals 和 assertTrue
- 进行Junit测试,TestCase.assertTrue失败的问题,无错误提示
- java api 在线中文以及英文版本
- AutoCAD.NET API 最新(2012)教程下载及在线视频教程DevTV 第7讲 Jigs
- junit 报错以及解决的办法
- Android版本号以及对应的API Level和版本代号
- C++ Assert()断言机制原理以及使用
- kafka-0.10.2.1的shell使用以及Java API
- 网站在线人数以及历史访问人数的统计代码
- Ogre API Reference OGRE API 在线参考 网址
- 浅谈Qt对OpenGL(ES)2.0以及高级OpenGL_API的支持
- 使用谷歌在线geocoding api解析地址
- eclipse 在线安装 spket 最新地址以及离线安装zip下载地址
- 支付宝API接口开发相关文档以及实例
- 开源免费的天气预报接口API以及全国所有地区代码(国家气象局提供)
- jqueryAPI在线查询
- 【iOS开发-6】iOS框架以及手册的在线阅读和PDF版本的iOS Technology Overview下载