How To Wirte a Simple JUnit Test Class?
Submitted by: AdministratorThis 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.*;
public class HelloTest {
@Test public void testHello() {
String message = "Hello World!";
Assert.assertEquals(12, message.length());
}
}
Submitted by: Administrator
import org.junit.*;
public class HelloTest {
@Test public void testHello() {
String message = "Hello World!";
Assert.assertEquals(12, message.length());
}
}
Submitted by: Administrator
Read Online JUnit Job Interview Questions And Answers
Top JUnit Questions
☺ | What Is JUnit? |
☺ | Why Does Poeple Import org.junit.Assert Statically? |
☺ | How To Wirte a Simple JUnit Test Class? |
☺ | Why Do You Use JUnit to Test Your Code? |
☺ | How Do You Launch a Debugger When a Test Fails? |
Top Testing Categories
☺ | Manual Testing Interview Questions. |
☺ | Rational TestSuite Interview Questions. |
☺ | QTP Interview Questions. |
☺ | Database Testing Interview Questions. |
☺ | Software QA Interview Questions. |