Unit Testing With Pure Java

Create a maven project. and add this class to test.

/**
 * Created by nhien.truong on 2/27/14.
 */
public class SimpleJavaTest {

    /**
     * Demo of unit testing
     * @param args
     */
    public static void main(String[] args) {

        double sum = new Calculator().add(2,3);
        if(sum!=5.1)
            System.err.println("The method add doesn't work well !!!");
        else{
            System.out.println("That's fantastic!!!");
        }
    }   
}

Output: 
>>The method doesn't work well !!!

Không có nhận xét nào:

Đăng nhận xét