[341] | 1 | package de.ugoe.cs.eventbench.assertions;
|
---|
| 2 |
|
---|
| 3 | import org.junit.*;
|
---|
| 4 | import static org.junit.Assert.*;
|
---|
| 5 |
|
---|
| 6 | /**
|
---|
| 7 | * The class <code>FileEqualsReplayTest</code> contains tests for the class
|
---|
| 8 | * <code>{@link FileEqualsReplay}</code>.
|
---|
| 9 | *
|
---|
| 10 | * @author Steffen Herbold
|
---|
| 11 | * @version 1.0
|
---|
| 12 | */
|
---|
| 13 | public class FileEqualsReplayTest {
|
---|
| 14 |
|
---|
| 15 | private final static String ENDLINE = System.getProperty("line.separator");
|
---|
| 16 |
|
---|
| 17 | @Test
|
---|
| 18 | public void testFileEqualsReplay_1() throws Exception {
|
---|
| 19 | String expectedFile = "expectedFileString";
|
---|
| 20 | String actualFile = "actualFileString";
|
---|
| 21 |
|
---|
| 22 | FileEqualsReplay result = new FileEqualsReplay(expectedFile, actualFile);
|
---|
| 23 |
|
---|
| 24 | assertNotNull(result);
|
---|
| 25 | assertEquals(expectedFile, result.expectedFile);
|
---|
| 26 | assertEquals(actualFile, result.actualFile);
|
---|
| 27 | }
|
---|
| 28 |
|
---|
| 29 | @Test(expected = java.security.InvalidParameterException.class)
|
---|
| 30 | public void testFileEqualsReplay_2() throws Exception {
|
---|
| 31 | String actualFile = "actualFileString";
|
---|
| 32 |
|
---|
| 33 | new FileEqualsReplay(null, actualFile);
|
---|
| 34 | }
|
---|
| 35 |
|
---|
| 36 | @Test(expected = java.security.InvalidParameterException.class)
|
---|
| 37 | public void testFileEqualsReplay_3() throws Exception {
|
---|
| 38 | String expectedFile = "expectedFileString";
|
---|
| 39 |
|
---|
| 40 | new FileEqualsReplay(expectedFile, null);
|
---|
| 41 | }
|
---|
| 42 |
|
---|
| 43 | @Test
|
---|
| 44 | public void testGetReplay_1() throws Exception {
|
---|
| 45 | FileEqualsReplay fixture = new FileEqualsReplay("", "");
|
---|
| 46 |
|
---|
| 47 | String result = fixture.getReplay();
|
---|
| 48 |
|
---|
| 49 | assertEquals(" <fileEquals actualFile=\"\" expectedFile=\"\"/>"
|
---|
| 50 | + ENDLINE, result);
|
---|
| 51 | }
|
---|
| 52 |
|
---|
| 53 | @Test
|
---|
| 54 | public void testGetReplay_2() throws Exception {
|
---|
| 55 |
|
---|
| 56 | FileEqualsReplay fixture = new FileEqualsReplay("expectedFileString",
|
---|
| 57 | "actualFileString");
|
---|
| 58 |
|
---|
| 59 | String result = fixture.getReplay();
|
---|
| 60 |
|
---|
| 61 | assertEquals(
|
---|
| 62 | " <fileEquals actualFile=\"actualFileString\" expectedFile=\"expectedFileString\"/>"
|
---|
| 63 | + ENDLINE, result);
|
---|
| 64 | }
|
---|
| 65 |
|
---|
| 66 | @Test
|
---|
| 67 | public void testGetTarget_1() throws Exception {
|
---|
| 68 | FileEqualsReplay fixture = new FileEqualsReplay("", "");
|
---|
| 69 |
|
---|
| 70 | String result = fixture.getTarget();
|
---|
| 71 |
|
---|
| 72 | assertEquals("targetNotUsed", result);
|
---|
| 73 | }
|
---|
| 74 |
|
---|
| 75 | public static void main(String[] args) {
|
---|
| 76 | new org.junit.runner.JUnitCore().run(FileEqualsReplayTest.class);
|
---|
| 77 | }
|
---|
| 78 | } |
---|