Changeset 1141 for trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/rules/metrics/TextInputEntryRepetitionsEvaluatorTest.java
- Timestamp:
- 03/27/13 15:01:00 (11 years ago)
- Location:
- trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/rules
- Files:
-
- 1 added
- 1 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/rules/metrics/TextInputEntryRepetitionsEvaluatorTest.java
r1040 r1141 13 13 // limitations under the License. 14 14 15 package de.ugoe.cs.autoquest.usability. evaluation.rule.evaluator;15 package de.ugoe.cs.autoquest.usability.rules.metrics; 16 16 17 import static de.ugoe.cs.autoquest.usability.evaluation.rule.set.RulesetFactory.textInputUsabiliyRuleset;18 17 import static de.ugoe.cs.autoquest.usability.testutil.FestConditionUtil.absent; 19 18 import static de.ugoe.cs.autoquest.usability.testutil.FestConditionUtil.highRecommendationSeverityLevel; … … 24 23 import static org.fest.assertions.api.Assertions.assertThat; 25 24 26 import java.util.EnumSet;27 28 import org.junit.After;29 import org.junit.Before;30 25 import org.junit.Test; 31 26 32 27 import com.google.common.base.Optional; 33 import com.google.common.base.Predicate;34 import com.google.common.collect.Iterables;35 28 36 29 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTree; 37 import de.ugoe.cs.autoquest.usability.evaluation.result.UsabilityDefect; 38 import de.ugoe.cs.autoquest.usability.evaluation.rule.set.UsabilityRule; 39 import de.ugoe.cs.autoquest.usability.tasktree.filter.FilterStatisticCache; 30 import de.ugoe.cs.autoquest.usability.result.UsabilityDefect; 31 import de.ugoe.cs.autoquest.usability.rules.metrics.TextInputEntryRepetitionsMetric; 40 32 41 33 /** … … 48 40 public class TextInputEntryRepetitionsEvaluatorTest extends AbstractUsabilityEvaluationTC { 49 41 50 private UsabilityRule ruleUnderTest;51 52 @Before53 public void initRuleUnderTest() {54 EnumSet<? extends UsabilityRule> ruleset = textInputUsabiliyRuleset().evaluationRules();55 this.ruleUnderTest = Iterables.find(ruleset, new Predicate<UsabilityRule>() {56 57 public boolean apply(UsabilityRule usabilityRule) {58 return usabilityRule.ruleIdentifier().equals("TEXT_FIELD_INPUT_REPETITIONS");59 }60 61 });62 }63 64 @After65 public void clearFilterStatisticCache() {66 FilterStatisticCache.instance().clear();67 }68 69 42 @Test 70 43 public void should_return_no_recommendation() { … … 73 46 ITaskTree taskTree = createTaskTree(spec); 74 47 // When 75 Optional<UsabilityDefect> recommendation = 76 new TextInputEntryRepetitionsEvaluator(this.ruleUnderTest, taskTree).evaluationResult(); 48 Optional<UsabilityDefect> recommendation = new TextInputEntryRepetitionsMetric(taskTree).check(); 77 49 // Then 78 50 assertThat(recommendation).is(absent()); … … 87 59 ITaskTree taskTree = createTaskTree(spec); 88 60 // When 89 Optional<UsabilityDefect> recommendation = 90 new TextInputEntryRepetitionsEvaluator(this.ruleUnderTest, taskTree).evaluationResult(); 61 Optional<UsabilityDefect> recommendation = new TextInputEntryRepetitionsMetric(taskTree).check(); 91 62 // Then 92 63 assertThat(recommendation).is(present()).has(infoRecommendationSeverityLevel()); … … 101 72 ITaskTree taskTree = createTaskTree(spec); 102 73 // When 103 Optional<UsabilityDefect> recommendation = 104 new TextInputEntryRepetitionsEvaluator(this.ruleUnderTest, taskTree).evaluationResult(); 74 Optional<UsabilityDefect> recommendation = new TextInputEntryRepetitionsMetric(taskTree).check(); 105 75 // Then 106 76 assertThat(recommendation).is(present()).has(lowRecommendationSeverityLevel()); … … 121 91 ITaskTree taskTree = createTaskTree(spec); 122 92 // When 123 Optional<UsabilityDefect> recommendation = 124 new TextInputEntryRepetitionsEvaluator(this.ruleUnderTest, taskTree).evaluationResult(); 93 Optional<UsabilityDefect> recommendation = new TextInputEntryRepetitionsMetric(taskTree).check(); 125 94 // Then 126 95 assertThat(recommendation).is(present()).has(mediumRecommendationSeverityLevel()); … … 141 110 ITaskTree taskTree = createTaskTree(spec); 142 111 // When 143 Optional<UsabilityDefect> recommendation = 144 new TextInputEntryRepetitionsEvaluator(this.ruleUnderTest, taskTree).evaluationResult(); 112 Optional<UsabilityDefect> recommendation = new TextInputEntryRepetitionsMetric(taskTree).check(); 145 113 // Then 146 114 assertThat(recommendation).is(present()).has(highRecommendationSeverityLevel());
Note: See TracChangeset
for help on using the changeset viewer.