|
1 | 1 | package org.biojava.nbio.core.sequence.io.embl; |
2 | 2 |
|
| 3 | +import org.junit.Assert; |
3 | 4 | import org.junit.Before; |
4 | 5 | import org.junit.Test; |
5 | 6 |
|
|
13 | 14 | */ |
14 | 15 | public class EmblReaderTest { |
15 | 16 |
|
16 | | - private EmblReader emblReader; |
17 | | - |
18 | | - @Before |
19 | | - public void setUp() { |
20 | | - emblReader = new EmblReader(); |
21 | | - } |
22 | 17 |
|
23 | 18 | @Test(expected = NullPointerException.class) |
24 | 19 | public void givenNullFileParameterWhenProcessEmblFileThenThrowException() throws IOException { |
25 | 20 | File file = null; |
26 | | - emblReader.process(file); |
| 21 | + EmblReader.process(file); |
27 | 22 |
|
28 | 23 | } |
29 | 24 |
|
30 | 25 | @Test(expected = IllegalArgumentException.class) |
31 | 26 | public void givenDirectoryWhenProcessEmblFileThenThrowException() throws IOException { |
32 | 27 | File file = new File("./src/test/resources"); |
33 | | - emblReader.process(file); |
| 28 | + EmblReader.process(file); |
| 29 | + } |
| 30 | + |
| 31 | + @Test |
| 32 | + public void givenAnEmilFileWhenProcessEmilFileThanTheSequenceShouldReturnAsExpected() throws IOException { |
| 33 | + File file = new File("./src/test/resources/test.embl"); |
| 34 | + EmblRecord emblRecord = EmblReader.process(file); |
| 35 | + Assert.assertEquals("acaagatgccattgtcccccggcctcctgctgctg" + |
| 36 | + "ctgctctccggggccacggccaccgctgccctgcccctggagggtggccccaccggcc" + |
| 37 | + "gagacagcgagcatatgcaggaagcggcaggaataaggaaaagcagcctcctgactttcc" + |
| 38 | + "tcgcttggtggtttgagtggacctcccaggccagtgccgggcccctcataggagaggaagc" + |
| 39 | + "tcgggaggtggccaggcggcaggaaggcgcacccccccagcaatccgcgcgccgggacagaa" + |
| 40 | + "tgccctgcaggaacttcttctggaagaccttctcctcctgcaaataaaacctcacccatgaatgc" + |
| 41 | + "tcacgcaagtttaattacagacctgaa",emblRecord.getSequence()); |
34 | 42 | } |
35 | 43 |
|
36 | 44 |
|
|
0 commit comments