Line | |
---|
1 | package nl.tno.massSequencing |
---|
2 | |
---|
3 | import grails.test.* |
---|
4 | |
---|
5 | class FastaServiceTests extends GrailsUnitTestCase { |
---|
6 | def fastaService |
---|
7 | |
---|
8 | protected void setUp() { |
---|
9 | super.setUp() |
---|
10 | |
---|
11 | mockLogging( FastaService.class, true ); |
---|
12 | |
---|
13 | fastaService = new FastaService(); |
---|
14 | |
---|
15 | } |
---|
16 | |
---|
17 | protected void tearDown() { |
---|
18 | super.tearDown() |
---|
19 | } |
---|
20 | |
---|
21 | void testCreateTag() { |
---|
22 | // Simple check for uniqueness on different lengths |
---|
23 | for( int length = 1; length <= 5; length++ ) { |
---|
24 | println "Checking uniqueness on length " + length |
---|
25 | |
---|
26 | int maxTags = 4 ** length; |
---|
27 | List tags = [] |
---|
28 | for( int tagNum = 0; tagNum < maxTags; tagNum++ ) { |
---|
29 | String tag = fastaService.createTag( length, tagNum ); |
---|
30 | assert tag.size() == length; |
---|
31 | tags << tag; |
---|
32 | } |
---|
33 | |
---|
34 | // All tags should be unique |
---|
35 | assert tags.unique().size() == tags.size(); |
---|
36 | assert tags.size() == maxTags |
---|
37 | } |
---|
38 | |
---|
39 | } |
---|
40 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.