-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathKmerAdjUnitTest.java
46 lines (42 loc) · 1.23 KB
/
KmerAdjUnitTest.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import static org.junit.Assert.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import junit.framework.Assert;
import org.junit.Test;
/**
*
*/
/**
* @author Siddhartha Das
*
*/
public class KmerAdjUnitTest {
KmerAdjacency kmerAdjTest = new KmerAdjacency();
@Test
public void test() {
String[] kmers= {"GAGG","CAGG","GGGG","GGGA","CAGG","AGGG","GGAG"};
HashMap<String,ArrayList> testResult = new HashMap<String,ArrayList>();
ArrayList<String> gga = new ArrayList<String>();
ArrayList<String> agg = new ArrayList<String>();
ArrayList<String> ggg = new ArrayList<String>();
ArrayList<String> cag = new ArrayList<String>();
ArrayList<String> gag = new ArrayList<String>();
gga.add("GAG");
agg.add("GGG");
ggg.add("GGG");
ggg.add("GGA");
cag.add("AGG");
cag.add("AGG");
gag.add("AGG");
testResult.put("GGA", gga);
testResult.put("AGG", agg);
testResult.put("CAG", cag);
testResult.put("GGG", ggg);
testResult.put("GAG", gag);
kmerAdjTest.setKmerList(kmers);
HashMap<String,ArrayList> assertedResult = new HashMap<String,ArrayList>();
assertedResult = kmerAdjTest.returnAdjacencyList();
assertEquals(testResult,assertedResult);
}
}