Assert: assertNull(String message, Object value) : TestCase « junit.framework « Java by API






Assert: assertNull(String message, Object value)

 

import junit.framework.TestCase;

public class TestLargest extends TestCase {
  public TestLargest(String name) {
    super(name);
  }

  public void testEmpty() {
      assertNull("it should be null", null);

  }
}

   
  








Related examples in the same category

1.extends TestCase
2.Assert.fail(String message)
3.Assert: assertEquals(Object expected, Object actual)
4.Assert: assertEquals(String expected, String actual)
5.Assert: assertEquals(String message, double expected, double actual, double precision)
6.Assert: assertEquals(int expected, int actual)
7.Assert: assertFalse(String message, boolean value)
8.Assert: assertNotSame(String message, Object expected, Object actual)
9.Assert: assertSame(String message, Object expected, Object actual)
10.Assert: assertTrue(String message, boolean value)