source: trunk/autoquest-core-events-test/src/test/java/de/ugoe/cs/autoquest/SequenceInstanceOfTest.java @ 922

Last change on this file since 922 was 922, checked in by sherbold, 12 years ago
  • renaming of packages from de.ugoe.cs.quest to de.ugoe.cs.autoquest
  • Property svn:mime-type set to text/plain
File size: 2.8 KB
Line 
1package de.ugoe.cs.autoquest;
2
3import java.util.ArrayList;
4import java.util.Collection;
5import java.util.LinkedList;
6import java.util.List;
7
8import org.junit.*;
9
10import static org.junit.Assert.*;
11import static org.mockito.Mockito.*;
12
13import de.ugoe.cs.autoquest.SequenceInstanceOf;
14import de.ugoe.cs.autoquest.eventcore.Event;
15import de.ugoe.cs.autoquest.eventcore.IEventType;
16
17
18/**
19 * The class <code>SequenceInstanceOfTest</code> contains tests for the
20 * class <code>{@link SequenceInstanceOf}</code>.
21 *
22 * @author Steffen Herbold
23 * @version 1.0
24 */
25public class SequenceInstanceOfTest {
26       
27        @Test
28        public void TestIsCollectionOfSequences_1() throws Exception {
29                Collection<List<Event>> sequences = new LinkedList<List<Event>>();
30                List<Event> sequence1 = new ArrayList<Event>();
31                sequence1.add(new Event(mock(IEventType.class)));
32                sequences.add(sequence1);
33               
34                boolean result = SequenceInstanceOf.isCollectionOfSequences(sequences);
35                assertTrue(result);
36        }
37       
38        @Test
39        public void TestIsCollectionOfSequences_2() throws Exception {
40                Collection<List<Event>> sequences = new LinkedList<List<Event>>();
41                List<Event> sequence1 = new ArrayList<Event>();
42                sequences.add(sequence1);
43               
44                boolean result = SequenceInstanceOf.isCollectionOfSequences(sequences);
45                assertFalse(result);
46        }
47       
48        @Test
49        public void TestIsCollectionOfSequences_3() throws Exception {
50                Collection<List<Event>> sequences = new LinkedList<List<Event>>();
51               
52                boolean result = SequenceInstanceOf.isCollectionOfSequences(sequences);
53                assertFalse(result);
54        }
55       
56        @Test
57        public void TestIsCollectionOfSequences_4() throws Exception {
58                boolean result = SequenceInstanceOf.isCollectionOfSequences(null);
59                assertFalse(result);
60        }
61       
62        @Test
63        public void TestIsCollectionOfSequences_5() throws Exception {
64                boolean result = SequenceInstanceOf.isCollectionOfSequences(new Object());
65                assertFalse(result);
66        }
67       
68        @Test
69        public void TestIsEventSequence_1() throws Exception {
70                List<Event> sequence = new ArrayList<Event>();
71                sequence.add(new Event(mock(IEventType.class)));
72               
73                boolean result = SequenceInstanceOf.isEventSequence(sequence);
74                assertTrue(result);
75        }
76       
77        @Test
78        public void TestIsEventSequence_2() throws Exception {
79                List<Event> sequence = new ArrayList<Event>();
80               
81                boolean result = SequenceInstanceOf.isEventSequence(sequence);
82                assertFalse(result);
83        }
84       
85        @Test
86        public void TestIsEventSequence_3() throws Exception {
87                boolean result = SequenceInstanceOf.isEventSequence(null);
88                assertFalse(result);
89        }
90       
91        @Test
92        public void TestIsEventSequence_4() throws Exception {
93                boolean result = SequenceInstanceOf.isEventSequence(new Object());
94                assertFalse(result);
95        }
96       
97       
98       
99        public static void main(String[] args) {
100                new org.junit.runner.JUnitCore().run(SequenceInstanceOfTest.class);
101        }
102}
Note: See TracBrowser for help on using the repository browser.