forked from exercism/java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHammingTest.java
More file actions
63 lines (50 loc) · 1.47 KB
/
HammingTest.java
File metadata and controls
63 lines (50 loc) · 1.47 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
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
import org.junit.Test;
import org.junit.Ignore;
public class HammingTest {
@Test
public void testNoDifferenceBetweenIdenticalStrands() {
assertThat(Hamming.compute("A", "A"), is(0));
}
@Ignore
@Test
public void testCompleteHammingDistanceOfForSingleNucleotideStrand() {
assertThat(Hamming.compute("A", "G"), is(1));
}
@Ignore
@Test
public void testCompleteHammingDistanceForSmallStrand() {
assertThat(Hamming.compute("AG", "CT"), is(2));
}
@Ignore
@Test
public void testSmallHammingDistance() {
assertThat(Hamming.compute("AT", "CT"), is(1));
}
@Ignore
@Test
public void testSmallHammingDistanceInLongerStrand() {
assertThat(Hamming.compute("GGACG", "GGTCG"), is(1));
}
@Ignore
@Test(expected = IllegalArgumentException.class)
public void testValidatesFirstStrandNotLonger() {
Hamming.compute("AAAG", "AAA");
}
@Ignore
@Test(expected = IllegalArgumentException.class)
public void testValidatesOtherStrandNotLonger() {
Hamming.compute("AAA", "AAAG");
}
@Ignore
@Test
public void testLargeHammingDistance() {
assertThat(Hamming.compute("GATACA", "GCATAA"), is(4));
}
@Ignore
@Test
public void testHammingDistanceInVeryLongStrand() {
assertThat(Hamming.compute("GGACGGATTCTG", "AGGACGGATTCT"), is(9));
}
}