Sha256: 98a5fe91a5ff56f0d6cf2896c27604b2fe008cbb4b819ec51cf150d91328bdce
Contents?: true
Size: 1.64 KB
Versions: 26
Compression:
Stored size: 1.64 KB
Contents
import static org.hamcrest.CoreMatchers.*; import static org.junit.Assert.*; import org.junit.Test; import org.junit.Ignore; import org.junit.Rule; import org.junit.rules.ExpectedException; public class HammingTest { @Rule public ExpectedException thrown = ExpectedException.none(); @Test public void testNoDifferenceBetweenIdenticalStrands() { assertThat(Hamming.compute("A", "A"), is(0)); } @Ignore @Test public void testHammingDistanceForSingleNucleotideStrand() { assertThat(Hamming.compute("A", "G"), is(1)); } @Ignore @Test public void testHammingDistanceForSmallStrand() { 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 public void testValidatesFirstStrandNotLonger() { thrown.expect(IllegalArgumentException.class); Hamming.compute("AAAG", "AAA"); } @Ignore @Test public void testValidatesOtherStrandNotLonger() { thrown.expect(IllegalArgumentException.class); 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)); } }
Version data entries
26 entries across 26 versions & 1 rubygems