Junit单元测试
junit属于白盒测试
测试分类:
常用的 junt3/junit4: junit3需要继承TestCase类 junit4通过注解实现
package junit4.demo;
public class MyMath {
public int add(int num1,int num2)
{
return num1+num2;
}
}
package junit4.test;
import junit4.demo.MyMath;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
public class MyMathTest
{
浙公网安备 33010602011771号