Repository navigation
Expand file tree
/
Copy pathHammingTest.java
More file actions
109 lines (87 loc) · 3.15 KB
/
Copy pathHammingTest.java
File metadata and controls
109 lines (87 loc) · 3.15 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import static org.junit.Assert.assertEquals;
public class HammingTest {
@Rule
public ExpectedException expectedException = ExpectedException.none();
@Test
public void testNoDistanceBetweenEmptyStrands() {
assertEquals(0, new Hamming("", "").getHammingDistance());
}
@Ignore("Remove to run test")
@Test
public void testNoDistanceBetweenShortIdenticalStrands() {
assertEquals(0, new Hamming("A", "A").getHammingDistance());
}
@Ignore("Remove to run test")
@Test
public void testNoDistanceBetweenLongIdenticalStrands() {
assertEquals(0, new Hamming("GGACTGA", "GGACTGA").getHammingDistance());
}
@Ignore("Remove to run test")
@Test
public void testCompleteDistanceInSingleNucleotideStrand() {
assertEquals(1, new Hamming("A", "G").getHammingDistance());
}
@Ignore("Remove to run test")
@Test
public void testCompleteDistanceInSmallStrand() {
assertEquals(2, new Hamming("AG", "CT").getHammingDistance());
}
@Ignore("Remove to run test")
@Test
public void testSmallDistanceInSmallStrand() {
assertEquals(1, new Hamming("AT", "CT").getHammingDistance());
}
@Ignore("Remove to run test")
@Test
public void testSmallDistanceInMediumStrand() {
assertEquals(1, new Hamming("GGACG", "GGTCG").getHammingDistance());
}
@Ignore("Remove to run test")
@Test
public void testSmallDistanceInLongStrand() {
assertEquals(2, new Hamming("ACCAGGG", "ACTATGG").getHammingDistance());
}
@Ignore("Remove to run test")
@Test
public void testNonUniqueCharacterInFirstStrand() {
assertEquals(1, new Hamming("AAG", "AAA").getHammingDistance());
}
@Ignore("Remove to run test")
@Test
public void testNonUniqueCharacterInSecondStrand() {
assertEquals(1, new Hamming("AAA", "AAG").getHammingDistance());
}
@Ignore("Remove to run test")
@Test
public void testSameNucleotidesInDifferentPositions() {
assertEquals(2, new Hamming("TAG", "GAT").getHammingDistance());
}
@Ignore("Remove to run test")
@Test
public void testLargeDistanceInPermutedStrand() {
assertEquals(4, new Hamming("GATACA", "GCATAA").getHammingDistance());
}
@Ignore("Remove to run test")
@Test
public void testLargeDistanceInOffByOneStrand() {
assertEquals(9, new Hamming("GGACGGATTCTG", "AGGACGGATTCT").getHammingDistance());
}
@Ignore("Remove to run test")
@Test
public void testValidatesFirstStrandNotLonger() {
expectedException.expect(IllegalArgumentException.class);
expectedException.expectMessage("leftStrand and rightStrand must be of equal length.");
new Hamming("AATG", "AAA");
}
@Ignore("Remove to run test")
@Test
public void testValidatesSecondStrandNotLonger() {
expectedException.expect(IllegalArgumentException.class);
expectedException.expectMessage("leftStrand and rightStrand must be of equal length.");
new Hamming("ATA", "AGTG");
}
}