source: trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/UsabilityEvaluationReportTest.java @ 1141

Last change on this file since 1141 was 1040, checked in by adeicke, 11 years ago
  • Removed lombok related annotations and util class
  • Added comments and formating due to match project defaults
  • Property svn:mime-type set to text/plain
File size: 3.0 KB
Line 
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
15package de.ugoe.cs.autoquest.usability;
16
17import static de.ugoe.cs.autoquest.usability.testutil.FestConditionUtil.noUsabilityGuidlineRecommendations;
18import static de.ugoe.cs.autoquest.usability.testutil.FestConditionUtil.usabilityGuidlineRecommendations;
19import static org.fest.assertions.api.Assertions.assertThat;
20
21import java.util.Collections;
22import java.util.List;
23
24import org.fest.util.Lists;
25import org.junit.Test;
26
27import de.ugoe.cs.autoquest.usability.evaluation.result.UsabilityDefectSeverityLevel;
28import de.ugoe.cs.autoquest.usability.evaluation.result.UsabilityDefect;
29import de.ugoe.cs.autoquest.usability.evaluation.result.UsabilityDefectFactory;
30import de.ugoe.cs.autoquest.usability.testutil.DummyUsabilityGuidlineDescriptionResolver;
31import de.ugoe.cs.autoquest.usability.testutil.DummyUsabilityRuleset;
32
33/**
34 * <p>
35 * TODO comment
36 * </p>
37 *
38 * @author Alexander Deicke
39 */
40public class UsabilityEvaluationReportTest {
41
42    @Test(expected = NullPointerException.class)
43    public void usability_report_from_null_should_throw_exception() {
44        UsabilityEvaluationReport.from(null);
45    }
46
47    @Test
48    public void usability_report_from_empty_list_has_no_recommendations() {
49        UsabilityEvaluationReport evaluationReport =
50            UsabilityEvaluationReport.from(Collections.<UsabilityDefect> emptyList());
51        assertThat(evaluationReport).isNotNull().has(noUsabilityGuidlineRecommendations());
52    }
53
54    @Test
55    public void usability_report_from_non_empty_list_has_recommendations() {
56        List<UsabilityDefect> guidlineRecommendations =
57            Lists
58                .newArrayList(new UsabilityDefectFactory(
59                                                         new DummyUsabilityGuidlineDescriptionResolver())
60                    .createUsabilityGuidlineRecommendation(UsabilityDefectSeverityLevel.INFO,
61                                                           new DummyUsabilityRuleset()
62                                                               .evaluationRules().iterator().next(),
63                                                           Collections.<String, String> emptyMap()));
64        UsabilityEvaluationReport evaluationReport =
65            UsabilityEvaluationReport.from(guidlineRecommendations);
66        assertThat(evaluationReport).isNotNull().has(usabilityGuidlineRecommendations());
67    }
68
69}
Note: See TracBrowser for help on using the repository browser.