How To Wirte a Simple JUnit Test Class

Q

How To Wirte a Simple JUnit Test Class?

✍: FYICenter.com QA Team

A

This is a common test in a job interview. You should be able to write this simple test class with one test method:

import org.junit.*; 
// by FYICenter.com
public class HelloTest { 
    @Test public void testHello() {
        String message = "Hello World!";
        Assert.assertEquals(12, message.length());
    }
}

2008-01-11, 7550👍, 0💬