package com.quizdeck.analysis;

import com.quizdeck.Application.QuizDeckApplication;
import com.quizdeck.analysis.exceptions.AnalysisException;
import com.quizdeck.analysis.inputs.*;
import com.quizdeck.analysis.outputs.QuizAnalysisData;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.SpringApplicationConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import java.util.LinkedList;

/**
 * Test for the QuizAnalysisFactory
 *
 * @author Alex
 */
@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = QuizDeckApplication.class)
public class QuizAnalysisFactoryTest {
    @Test
    public void dummyTest() throws AnalysisException {
        LinkedList<Question> questions = new LinkedList<>();
        questions.add(new MockQuestion(1, new MockSelection('0')));
        questions.add(new MockQuestion(2, new MockSelection('1')));


        MockMember steve = new MockMember();
        LinkedList<Response> responses = new LinkedList<>();
        for(int i = 0; i < 50; i++)
            responses.add(new MockResponse(steve, new MockSelection(Integer.toString(i).charAt(0)), questions.get(0), i));

        QuizAnalysisFactory factory = new QuizAnalysisFactory();
        factory.setResponses(responses);
        factory.setQuestions(questions);
        factory.setQuizID("Q1");
        factory.setDeckID("D1");
        factory.setOwner(steve);
        StaticAnalysis analysis = (StaticAnalysis) factory.getAnalysisUsing(QuizAlgorithm.ACCURACY);
        analysis.performAnalysis();
        QuizAnalysisData result = (QuizAnalysisData) analysis.getResults();
    }
}


@@ -170,71 +170,44 @@
 sis.
-inputs.*;%0Aimport com.quizdeck.analysis.outputs.QuizAnalysisData
+exceptions.InsufficientDataException
 ;%0Aim
@@ -652,16 +652,60 @@
    @Test
+(expected = InsufficientDataException.class)
 %0A    pub
@@ -717,13 +717,24 @@
 oid 
-dummy
+insufficientData
 Test
@@ -775,464 +775,250 @@
     
-LinkedList%3CQuestion%3E questions = new LinkedList%3C%3E();%0A        questions.add(new MockQuestion(1, new MockSelection('0')));%0A        questions.add(new MockQuestion(2, new MockSelection('1')));%0A%0A%0A        MockMember steve = new MockMember();%0A        LinkedList%3CResponse%3E responses = new LinkedList%3C%3E();%0A        for(int i = 0; i %3C 50; i++)
+QuizAnalysisFactory factory = new QuizAnalysisFactory();%0A        StaticAnalysis analysis = (StaticAnalysis) factory.getAnalysisUsing(QuizAlgorithm.ACCURACY);
 %0A    
+%7D%0A%0A
     
-    responses.add(new MockResponse(steve, new MockSelection(Integer.toString(i).charAt(0)), questions.get(0), i));%0A
+@Test%0A    public void constructEmptyAnalysis() throws AnalysisException %7B
 %0A   
@@ -1102,27 +1102,30 @@
 .set
-Responses(responses
+Owner(new MockMember()
 );%0A 
@@ -1146,27 +1146,23 @@
 .set
-Questions(questions
+DeckID(%22DeckID%22
 );%0A 
@@ -1188,17 +1188,21 @@
 uizID(%22Q
-1
+uizID
 %22);%0A    
@@ -1220,52 +1220,86 @@
 .set
-DeckID(%22D1%22);%0A        factory.setOwner(steve
+Questions(new LinkedList%3C%3E());%0A        factory.setResponses(new LinkedList%3C%3E()
 );%0A 
@@ -1402,120 +1402,8 @@
 Y);%0A
-        analysis.performAnalysis();%0A        QuizAnalysisData result = (QuizAnalysisData) analysis.getResults();%0A
     

Make QuizAnalysisFactory unit tests more specific.