summaryrefslogtreecommitdiff
path: root/tst/com/p4square/grow/model/ImageQuestionTest.java
diff options
context:
space:
mode:
authorJesse Morgan <jesse@jesterpm.net>2016-04-09 14:22:20 -0700
committerJesse Morgan <jesse@jesterpm.net>2016-04-09 15:48:01 -0700
commit3102d8bce3426d9cf41aeaf201c360d342677770 (patch)
tree38c4f1e8828f9af9c4b77a173bee0d312b321698 /tst/com/p4square/grow/model/ImageQuestionTest.java
parentbbf907e51dfcf157bdee24dead1d531122aa25db (diff)
Switching from Ivy+Ant to Maven.
Diffstat (limited to 'tst/com/p4square/grow/model/ImageQuestionTest.java')
-rw-r--r--tst/com/p4square/grow/model/ImageQuestionTest.java74
1 files changed, 0 insertions, 74 deletions
diff --git a/tst/com/p4square/grow/model/ImageQuestionTest.java b/tst/com/p4square/grow/model/ImageQuestionTest.java
deleted file mode 100644
index 28ccdb2..0000000
--- a/tst/com/p4square/grow/model/ImageQuestionTest.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright 2013 Jesse Morgan
- */
-
-package com.p4square.grow.model;
-
-import org.junit.Before;
-import org.junit.Test;
-
-import static org.junit.Assert.*;
-
-/**
- * Test for ImageQuestion.
- *
- * @author Jesse Morgan <jesse@jesterpm.net>
- */
-public class ImageQuestionTest {
- private static final double DELTA = 1e-4;
-
- public static void main(String... args) {
- org.junit.runner.JUnitCore.main(ImageQuestionTest.class.getName());
- }
-
- private Question mQuestion;
-
- @Before
- public void setUp() {
- mQuestion = new ImageQuestion();
-
- Answer a1 = new Answer();
- a1.setScore(2);
-
- Answer a2 = new Answer();
- a2.setScore(4);
-
- mQuestion.getAnswers().put("a1", a1);
- mQuestion.getAnswers().put("a2", a2);
- }
-
- /**
- * The ScoringEngines are tested extensively independently, so simply
- * verify that we get the expected results for our input.
- */
- @Test
- public void testScoreAnswer() {
- Score score = new Score();
- RecordedAnswer answer = new RecordedAnswer();
-
- answer.setAnswerId("a1");
- assertTrue(mQuestion.scoreAnswer(score, answer));
- assertEquals(2, score.sum, DELTA);
- assertEquals(1, score.count);
-
- answer.setAnswerId("a2");
- assertTrue(mQuestion.scoreAnswer(score, answer));
- assertEquals(6, score.sum, DELTA);
- assertEquals(2, score.count);
-
- try {
- answer.setAnswerId("unknown");
- assertTrue(mQuestion.scoreAnswer(score, answer));
- fail("Should have thrown exception.");
- } catch (IllegalArgumentException e) {
- }
- }
-
- /**
- * Verify the correct type string is returned.
- */
- @Test
- public void testType() {
- assertEquals("image", mQuestion.getType().toString());
- }
-}