Merge branch 'develop' into LibrAlign
[taxeditor.git] / eu.etaxonomy.taxeditor.molecular / src / test / java / eu / etaxonomy / taxeditor / molecular / io / SequenceIDIteratorTest.java
1 // $Id$
2 /**
3 * Copyright (C) 2016 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
6 *
7 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 * See LICENSE.TXT at the top of this package for the full license terms.
9 */
10 package eu.etaxonomy.taxeditor.molecular.io;
11
12
13 import static org.junit.Assert.assertEquals;
14 import static org.junit.Assert.assertFalse;
15 import static org.junit.Assert.assertTrue;
16
17 import org.junit.Test;
18
19
20
21 /**
22 * @author Ben Stöver
23 * @date 29.04.2016
24 */
25 public class SequenceIDIteratorTest {
26 @Test
27 public void test_next() {
28 SequenceIDIterator iterator = new SequenceIDIterator(3, true);
29
30 for (int i = 0; i < 3; i++) {
31 assertTrue(iterator.hasNext());
32 assertEquals("seqSingleRead" + i, iterator.next());
33 }
34 assertTrue(iterator.hasNext());
35 assertEquals("seqConsensus", iterator.next());
36 assertFalse(iterator.hasNext());
37 }
38
39
40 @Test
41 public void test_next_woConsensus() {
42 SequenceIDIterator iterator = new SequenceIDIterator(3, false);
43
44 for (int i = 0; i < 3; i++) {
45 assertTrue(iterator.hasNext());
46 assertEquals("seqSingleRead" + i, iterator.next());
47 }
48 assertFalse(iterator.hasNext());
49 }
50 }