summaryrefslogtreecommitdiffstats
path: root/junit4/src/test/java/junit/tests/framework/AssertionFailedErrorTest.java
blob: 3dd6b1fb0fabfd813bc0c9c0a8925307b513f183 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package junit.tests.framework;

import junit.framework.AssertionFailedError;
import junit.framework.TestCase;

public class AssertionFailedErrorTest extends TestCase {
	private static final String ARBITRARY_MESSAGE= "arbitrary message";

	public void testCreateErrorWithoutMessage() throws Exception {
		AssertionFailedError error= new AssertionFailedError();
		assertNull(error.getMessage());
	}

	public void testCreateErrorWithMessage() throws Exception {
		AssertionFailedError error= new AssertionFailedError(ARBITRARY_MESSAGE);
		assertEquals(ARBITRARY_MESSAGE, error.getMessage());
	}

	public void testCreateErrorWithoutMessageInsteadOfNull() throws Exception {
		AssertionFailedError error= new AssertionFailedError(null);
		assertEquals("", error.getMessage());
	}
}