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.usability; |
---|
16 | |
---|
17 | import static org.junit.Assert.assertNotNull; |
---|
18 | import static org.junit.Assert.assertNotSame; |
---|
19 | |
---|
20 | import java.util.HashMap; |
---|
21 | import java.util.LinkedList; |
---|
22 | import java.util.List; |
---|
23 | import java.util.Map; |
---|
24 | |
---|
25 | import org.junit.Test; |
---|
26 | |
---|
27 | import de.ugoe.cs.autoquest.usability.UsabilitySmellDescription; |
---|
28 | |
---|
29 | /** |
---|
30 | * @author Patrick Harms |
---|
31 | */ |
---|
32 | public class UsabilitySmellDescriptionTest { |
---|
33 | |
---|
34 | /** |
---|
35 | * |
---|
36 | */ |
---|
37 | @Test |
---|
38 | public void testInitialization() { |
---|
39 | for (UsabilitySmellDescription description : UsabilitySmellDescription.values()) { |
---|
40 | assertNotNull(description.toString()); |
---|
41 | assertNotSame("", description.toString()); |
---|
42 | System.err.println(description); |
---|
43 | } |
---|
44 | } |
---|
45 | |
---|
46 | /** |
---|
47 | * |
---|
48 | */ |
---|
49 | @Test |
---|
50 | public void testParameterization_01() { |
---|
51 | for (UsabilitySmellDescription description : UsabilitySmellDescription.values()) { |
---|
52 | Map<String, Object> parameters = new HashMap<String, Object>(); |
---|
53 | |
---|
54 | for (String parameter : description.getDescriptionParameters()) { |
---|
55 | parameters.put(parameter, "<parameter " + parameter + ">"); |
---|
56 | } |
---|
57 | |
---|
58 | assertNotNull(description.toString(parameters)); |
---|
59 | assertNotSame("", description.toString(parameters)); |
---|
60 | System.err.println(description.toString(parameters)); |
---|
61 | } |
---|
62 | } |
---|
63 | |
---|
64 | |
---|
65 | /** |
---|
66 | * |
---|
67 | */ |
---|
68 | @Test |
---|
69 | public void testParameterization_02() { |
---|
70 | for (UsabilitySmellDescription description : UsabilitySmellDescription.values()) { |
---|
71 | Map<String, Object> parameters = new HashMap<String, Object>(); |
---|
72 | |
---|
73 | for (String parameter : description.getDescriptionParameters()) { |
---|
74 | List<String> values = new LinkedList<String>(); |
---|
75 | values.add("<parameter " + parameter + " value 1>"); |
---|
76 | values.add("<parameter " + parameter + " value 2>"); |
---|
77 | values.add("<parameter " + parameter + " value 3>"); |
---|
78 | parameters.put(parameter, values); |
---|
79 | } |
---|
80 | |
---|
81 | assertNotNull(description.toString(parameters)); |
---|
82 | assertNotSame("", description.toString(parameters)); |
---|
83 | System.err.println(description.toString(parameters)); |
---|
84 | } |
---|
85 | } |
---|
86 | |
---|
87 | } |
---|