package de.ugoe.cs.quest; import java.util.ArrayList; import java.util.Collection; import java.util.LinkedList; import java.util.List; import org.junit.*; import static org.junit.Assert.*; import de.ugoe.cs.quest.SequenceInstanceOf; import de.ugoe.cs.quest.eventcore.Event; /** * The class SequenceInstanceOfTest contains tests for the * class {@link SequenceInstanceOf}. * * @author Steffen Herbold * @version 1.0 */ public class SequenceInstanceOfTest { @Test public void TestIsCollectionOfSequences_1() throws Exception { Collection>> sequences = new LinkedList>>(); List> sequence1 = new ArrayList>(); sequence1.add(new Event("a")); sequences.add(sequence1); boolean result = SequenceInstanceOf.isCollectionOfSequences(sequences); assertTrue(result); } @Test public void TestIsCollectionOfSequences_2() throws Exception { Collection>> sequences = new LinkedList>>(); List> sequence1 = new ArrayList>(); sequences.add(sequence1); boolean result = SequenceInstanceOf.isCollectionOfSequences(sequences); assertFalse(result); } @Test public void TestIsCollectionOfSequences_3() throws Exception { Collection>> sequences = new LinkedList>>(); boolean result = SequenceInstanceOf.isCollectionOfSequences(sequences); assertFalse(result); } @Test public void TestIsCollectionOfSequences_4() throws Exception { boolean result = SequenceInstanceOf.isCollectionOfSequences(null); assertFalse(result); } @Test public void TestIsCollectionOfSequences_5() throws Exception { boolean result = SequenceInstanceOf.isCollectionOfSequences(new Object()); assertFalse(result); } @Test public void TestIsEventSequence_1() throws Exception { List> sequence = new ArrayList>(); sequence.add(new Event("a")); boolean result = SequenceInstanceOf.isEventSequence(sequence); assertTrue(result); } @Test public void TestIsEventSequence_2() throws Exception { List> sequence = new ArrayList>(); boolean result = SequenceInstanceOf.isEventSequence(sequence); assertFalse(result); } @Test public void TestIsEventSequence_3() throws Exception { boolean result = SequenceInstanceOf.isEventSequence(null); assertFalse(result); } @Test public void TestIsEventSequence_4() throws Exception { boolean result = SequenceInstanceOf.isEventSequence(new Object()); assertFalse(result); } public static void main(String[] args) { new org.junit.runner.JUnitCore().run(SequenceInstanceOfTest.class); } }