package de.ugoe.cs.autoquest.assertions; import org.junit.*; import de.ugoe.cs.autoquest.assertions.TextEqualsReplay; import static org.junit.Assert.*; /** * The class TextEqualsReplayTest contains tests for the class * {@link TextEqualsReplay}. * * @author Steffen Herbold * @version 1.0 */ public class TextEqualsReplayTest { private final static String ENDLINE = System.getProperty("line.separator"); @Test public void testTextEqualsReplay_1() throws Exception { String expectedValue = "expectedValueString"; String target = "targetString"; TextEqualsReplay result = new TextEqualsReplay(expectedValue, target); assertNotNull(result); assertEquals(expectedValue, result.expectedValue); assertEquals(target, result.target); } @Test public void testTextEqualsReplay_2() throws Exception { String target = "targetString"; TextEqualsReplay result = new TextEqualsReplay(null, target); assertNotNull(result); assertEquals(null, result.expectedValue); assertEquals(target, result.target); } @Test(expected = java.lang.IllegalArgumentException.class) public void testTextEqualsReplay_3() throws Exception { String expectedValue = "expectedValueString"; new TextEqualsReplay(expectedValue, null); } @Test public void testGetReplay_1() throws Exception { TextEqualsReplay fixture = new TextEqualsReplay("", ""); String result = fixture.getReplay(); assertEquals(" " + ENDLINE + "" + ENDLINE + ENDLINE + "" + ENDLINE + "" + ENDLINE, result); } @Test public void testGetReplay_2() throws Exception { TextEqualsReplay fixture = new TextEqualsReplay("expectedValueString", "targetString"); String result = fixture.getReplay(); assertEquals(" " + ENDLINE + "" + ENDLINE + "targetString" + ENDLINE + "" + ENDLINE + "" + ENDLINE, result); } public static void main(String[] args) { new org.junit.runner.JUnitCore().run(TextEqualsReplayTest.class); } }