[1040] | 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 |
|
---|
[1030] | 15 | package de.ugoe.cs.autoquest.usability;
|
---|
| 16 |
|
---|
| 17 | import static de.ugoe.cs.autoquest.usability.evaluation.rule.set.RulesetFactory.emptyUsabilityRuleset;
|
---|
| 18 | import static org.fest.assertions.api.Assertions.assertThat;
|
---|
| 19 |
|
---|
| 20 | import org.junit.Test;
|
---|
| 21 |
|
---|
| 22 | import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTree;
|
---|
| 23 | import de.ugoe.cs.autoquest.usability.UsabilityEvaluationFacade.ExecuteUsabilityEvaluationStep;
|
---|
| 24 | import de.ugoe.cs.autoquest.usability.testutil.DummyUsabilityRuleset;
|
---|
| 25 | import de.ugoe.cs.autoquest.usability.testutil.TaskTreeBuilder;
|
---|
| 26 |
|
---|
[1040] | 27 | /**
|
---|
| 28 | * <p>
|
---|
| 29 | * TODO comment
|
---|
| 30 | * </p>
|
---|
| 31 | *
|
---|
| 32 | * @author Alexander Deicke
|
---|
| 33 | */
|
---|
[1030] | 34 | public class UsabilityEvaluationFacadeTest {
|
---|
| 35 |
|
---|
| 36 | @Test(expected = NullPointerException.class)
|
---|
| 37 | public void apply_null_for_ruleset_should_throw_exception() {
|
---|
| 38 | UsabilityEvaluationFacade.applyUsabilityRuleset(null);
|
---|
| 39 | }
|
---|
[1040] | 40 |
|
---|
[1030] | 41 | @Test
|
---|
| 42 | public void apply_empty_ruleset_should_return_execute_usability_evaluation_step() {
|
---|
[1040] | 43 | ExecuteUsabilityEvaluationStep executeUsabilityEvaluationStep =
|
---|
| 44 | UsabilityEvaluationFacade.applyUsabilityRuleset(emptyUsabilityRuleset());
|
---|
| 45 | assertThat(executeUsabilityEvaluationStep)
|
---|
| 46 | .isInstanceOf(ExecuteUsabilityEvaluationStep.class);
|
---|
[1030] | 47 | }
|
---|
[1040] | 48 |
|
---|
[1030] | 49 | @Test(expected = NullPointerException.class)
|
---|
| 50 | public void evaluate_usability_of_null_should_throw_exception() {
|
---|
[1040] | 51 | UsabilityEvaluationFacade.applyUsabilityRuleset(emptyUsabilityRuleset())
|
---|
| 52 | .evaluateUsabilityOf(null);
|
---|
[1030] | 53 | }
|
---|
[1040] | 54 |
|
---|
[1030] | 55 | @Test
|
---|
[1040] | 56 | public void evaluate_usability_of_task_tree_against_empty_ruleset_should_return_empty_evaluation_report()
|
---|
| 57 | {
|
---|
| 58 | ITaskTree taskTree = TaskTreeBuilder.builder().root("Ich bin eine Wurzel").creatTaskTree();
|
---|
| 59 | UsabilityEvaluationReport evaluationReport =
|
---|
| 60 | UsabilityEvaluationFacade.applyUsabilityRuleset(emptyUsabilityRuleset())
|
---|
| 61 | .evaluateUsabilityOf(taskTree);
|
---|
| 62 | assertThat(evaluationReport).isNotNull();
|
---|
[1030] | 63 | }
|
---|
[1040] | 64 |
|
---|
[1030] | 65 | @Test
|
---|
[1040] | 66 | public void evaluate_usability_of_task_tree_against_dummy_ruleset_should_return_non_empty_evaluation_report()
|
---|
| 67 | {
|
---|
| 68 | ITaskTree taskTree = TaskTreeBuilder.builder().root("Ich bin eine Wurzel").creatTaskTree();
|
---|
| 69 | UsabilityEvaluationReport evaluationReport =
|
---|
| 70 | UsabilityEvaluationFacade.applyUsabilityRuleset(new DummyUsabilityRuleset())
|
---|
| 71 | .evaluateUsabilityOf(taskTree);
|
---|
[1030] | 72 | assertThat(evaluationReport).isNotNull();
|
---|
| 73 | }
|
---|
| 74 |
|
---|
| 75 | }
|
---|