@@ -24,86 +24,56 @@ public void testNoDistanceBetweenShortIdenticalStrands() {
2424
2525 @ Ignore ("Remove to run test" )
2626 @ Test
27- public void testNoDistanceBetweenLongIdenticalStrands () {
28- assertEquals (0 , new Hamming ("GGACTGA " , "GGACTGA " ).getHammingDistance ());
27+ public void testCompleteDistanceInSingleLetterDifferentStrands () {
28+ assertEquals (1 , new Hamming ("G " , "T " ).getHammingDistance ());
2929 }
3030
3131 @ Ignore ("Remove to run test" )
3232 @ Test
33- public void testCompleteDistanceInSingleNucleotideStrand () {
34- assertEquals (1 , new Hamming ("A " , "G " ).getHammingDistance ());
33+ public void testDistanceInLongIdenticalStrands () {
34+ assertEquals (0 , new Hamming ("GGACTGAAATCTG " , "GGACTGAAATCTG " ).getHammingDistance ());
3535 }
3636
3737 @ Ignore ("Remove to run test" )
3838 @ Test
39- public void testCompleteDistanceInSmallStrand () {
40- assertEquals (2 , new Hamming ("AG" , "CT" ).getHammingDistance ());
41- }
42-
43- @ Ignore ("Remove to run test" )
44- @ Test
45- public void testSmallDistanceInSmallStrand () {
46- assertEquals (1 , new Hamming ("AT" , "CT" ).getHammingDistance ());
47- }
48-
49- @ Ignore ("Remove to run test" )
50- @ Test
51- public void testSmallDistanceInMediumStrand () {
52- assertEquals (1 , new Hamming ("GGACG" , "GGTCG" ).getHammingDistance ());
53- }
54-
55- @ Ignore ("Remove to run test" )
56- @ Test
57- public void testSmallDistanceInLongStrand () {
58- assertEquals (2 , new Hamming ("ACCAGGG" , "ACTATGG" ).getHammingDistance ());
59- }
60-
61- @ Ignore ("Remove to run test" )
62- @ Test
63- public void testNonUniqueCharacterInFirstStrand () {
64- assertEquals (1 , new Hamming ("AAG" , "AAA" ).getHammingDistance ());
39+ public void testDistanceInLongDifferentStrands () {
40+ assertEquals (9 , new Hamming ("GGACGGATTCTG" , "AGGACGGATTCT" ).getHammingDistance ());
6541 }
6642
6743 @ Ignore ("Remove to run test" )
6844 @ Test
69- public void testNonUniqueCharacterInSecondStrand () {
70- assertEquals ( 1 , new Hamming ( "AAA" , "AAG" ). getHammingDistance () );
71- }
45+ public void testValidatesFirstStrandNotLonger () {
46+ expectedException . expect ( IllegalArgumentException . class );
47+ expectedException . expectMessage ( "leftStrand and rightStrand must be of equal length." );
7248
73- @ Ignore ("Remove to run test" )
74- @ Test
75- public void testSameNucleotidesInDifferentPositions () {
76- assertEquals (2 , new Hamming ("TAG" , "GAT" ).getHammingDistance ());
49+ new Hamming ("AATG" , "AAA" );
7750 }
7851
7952 @ Ignore ("Remove to run test" )
8053 @ Test
81- public void testLargeDistanceInPermutedStrand () {
82- assertEquals ( 4 , new Hamming ( "GATACA" , "GCATAA" ). getHammingDistance () );
83- }
54+ public void testValidatesSecondStrandNotLonger () {
55+ expectedException . expect ( IllegalArgumentException . class );
56+ expectedException . expectMessage ( "leftStrand and rightStrand must be of equal length." );
8457
85- @ Ignore ("Remove to run test" )
86- @ Test
87- public void testLargeDistanceInOffByOneStrand () {
88- assertEquals (9 , new Hamming ("GGACGGATTCTG" , "AGGACGGATTCT" ).getHammingDistance ());
58+ new Hamming ("ATA" , "AGTG" );
8959 }
9060
9161 @ Ignore ("Remove to run test" )
9262 @ Test
93- public void testValidatesFirstStrandNotLonger () {
63+ public void testDisallowLeftEmptyStrand () {
9464 expectedException .expect (IllegalArgumentException .class );
95- expectedException .expectMessage ("leftStrand and rightStrand must be of equal length. " );
65+ expectedException .expectMessage ("left strand must not be empty " );
9666
97- new Hamming ("AATG " , "AAA " );
67+ new Hamming ("" , "G " );
9868 }
9969
10070 @ Ignore ("Remove to run test" )
10171 @ Test
102- public void testValidatesSecondStrandNotLonger () {
72+ public void testDisallowRightEmptyStrand () {
10373 expectedException .expect (IllegalArgumentException .class );
104- expectedException .expectMessage ("leftStrand and rightStrand must be of equal length ." );
74+ expectedException .expectMessage ("right strand must not be empty ." );
10575
106- new Hamming ("ATA " , "AGTG " );
76+ new Hamming ("G " , "" );
10777 }
10878
10979}
0 commit comments