1 | // Copyright 2012 Georg-August-Universität Göttingen, Germany
|
---|
2 | //
|
---|
3 | // Licensed under the Apache License, Version 2.0 (the "License");
|
---|
4 | // you may not use this file except in compliance with the License.
|
---|
5 | // You may obtain a copy of the License at
|
---|
6 | //
|
---|
7 | // http://www.apache.org/licenses/LICENSE-2.0
|
---|
8 | //
|
---|
9 | // Unless required by applicable law or agreed to in writing, software
|
---|
10 | // distributed under the License is distributed on an "AS IS" BASIS,
|
---|
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
---|
12 | // See the License for the specific language governing permissions and
|
---|
13 | // limitations under the License.
|
---|
14 |
|
---|
15 | package de.ugoe.cs.autoquest.assertions;
|
---|
16 |
|
---|
17 | import org.junit.*;
|
---|
18 |
|
---|
19 | import de.ugoe.cs.autoquest.assertions.FileEqualsReplay;
|
---|
20 | import static org.junit.Assert.*;
|
---|
21 |
|
---|
22 | /**
|
---|
23 | * The class <code>FileEqualsReplayTest</code> contains tests for the class
|
---|
24 | * <code>{@link FileEqualsReplay}</code>.
|
---|
25 | *
|
---|
26 | * @author Steffen Herbold
|
---|
27 | * @version 1.0
|
---|
28 | */
|
---|
29 | public class FileEqualsReplayTest {
|
---|
30 |
|
---|
31 | private final static String ENDLINE = System.getProperty("line.separator");
|
---|
32 |
|
---|
33 | @Test
|
---|
34 | public void testFileEqualsReplay_1() throws Exception {
|
---|
35 | String expectedFile = "expectedFileString";
|
---|
36 | String actualFile = "actualFileString";
|
---|
37 |
|
---|
38 | FileEqualsReplay result = new FileEqualsReplay(expectedFile, actualFile);
|
---|
39 |
|
---|
40 | assertNotNull(result);
|
---|
41 | assertEquals(expectedFile, result.expectedFile);
|
---|
42 | assertEquals(actualFile, result.actualFile);
|
---|
43 | }
|
---|
44 |
|
---|
45 | @Test(expected = java.lang.IllegalArgumentException.class)
|
---|
46 | public void testFileEqualsReplay_2() throws Exception {
|
---|
47 | String actualFile = "actualFileString";
|
---|
48 |
|
---|
49 | new FileEqualsReplay(null, actualFile);
|
---|
50 | }
|
---|
51 |
|
---|
52 | @Test(expected = java.lang.IllegalArgumentException.class)
|
---|
53 | public void testFileEqualsReplay_3() throws Exception {
|
---|
54 | String expectedFile = "expectedFileString";
|
---|
55 |
|
---|
56 | new FileEqualsReplay(expectedFile, null);
|
---|
57 | }
|
---|
58 |
|
---|
59 | @Test
|
---|
60 | public void testGetReplay_1() throws Exception {
|
---|
61 | FileEqualsReplay fixture = new FileEqualsReplay("", "");
|
---|
62 |
|
---|
63 | String result = fixture.getReplay();
|
---|
64 |
|
---|
65 | assertEquals(" <fileEquals actualFile=\"\" expectedFile=\"\"/>"
|
---|
66 | + ENDLINE, result);
|
---|
67 | }
|
---|
68 |
|
---|
69 | @Test
|
---|
70 | public void testGetReplay_2() throws Exception {
|
---|
71 |
|
---|
72 | FileEqualsReplay fixture = new FileEqualsReplay("expectedFileString",
|
---|
73 | "actualFileString");
|
---|
74 |
|
---|
75 | String result = fixture.getReplay();
|
---|
76 |
|
---|
77 | assertEquals(
|
---|
78 | " <fileEquals actualFile=\"actualFileString\" expectedFile=\"expectedFileString\"/>"
|
---|
79 | + ENDLINE, result);
|
---|
80 | }
|
---|
81 |
|
---|
82 | public static void main(String[] args) {
|
---|
83 | new org.junit.runner.JUnitCore().run(FileEqualsReplayTest.class);
|
---|
84 | }
|
---|
85 | } |
---|