示例#1
0
 public void Long_identical_strands()
 {
     Assert.Equal(0, Hamming.Distance("GGACTGA", "GGACTGA"));
 }
示例#2
0
 public void Disallow_second_strand_longer()
 {
     Assert.Throws <ArgumentException>(() => Hamming.Distance("ATA", "AGTG"));
 }
示例#3
0
 public void Identical_strands()
 {
     Assert.Equal(0, Hamming.Distance("A", "A"));
 }
示例#4
0
 public void null_strands()
 {
     Assert.Throws <ArgumentException>(() => Hamming.Distance(null, null));
 }
示例#5
0
 public void Disallow_first_strand_longer()
 {
     Assert.Throws <ArgumentException>(() => Hamming.Distance("AATG", "AAA"));
 }
示例#6
0
 public void Small_distance_in_small_strands()
 {
     Assert.Equal(1, Hamming.Distance("AT", "CT"));
 }
示例#7
0
 public void Small_distance_in_long_strands()
 {
     Assert.Equal(2, Hamming.Distance("ACCAGGG", "ACTATGG"));
 }
示例#8
0
 public void Disallow_right_empty_strand()
 {
     Assert.Throws <ArgumentException>(() => Hamming.Distance("G", ""));
 }
示例#9
0
 public void Same_nucleotides_in_different_positions()
 {
     Assert.Equal(2, Hamming.Distance("TAG", "GAT"));
 }
示例#10
0
 public void Single_letter_different_strands()
 {
     Assert.Equal(1, Hamming.Distance("G", "T"));
 }
示例#11
0
 public void Long_different_strands()
 {
     Assert.Equal(9, Hamming.Distance("GGACGGATTCTG", "AGGACGGATTCT"));
 }
示例#12
0
 public void Single_letter_identical_strands()
 {
     Assert.Equal(0, Hamming.Distance("A", "A"));
 }
示例#13
0
 public void Null_strands()
 {
     Assert.Equal(0, Hamming.Distance(null, null));
 }
示例#14
0
    public void Long_Strand()
    {
        string strand = new string(Enumerable.Repeat('A', 1_000_000_000).ToArray());

        Assert.Equal(0, Hamming.Distance(strand, strand));
    }
示例#15
0
 public void Complete_distance_in_single_nucleotide_strands()
 {
     Assert.Equal(1, Hamming.Distance("A", "G"));
 }
示例#16
0
 public void Large_distance()
 {
     Assert.Equal(4, Hamming.Distance("GATACA", "GCATAA"));
 }
示例#17
0
 public void Complete_distance_in_small_strands()
 {
     Assert.Equal(2, Hamming.Distance("AG", "CT"));
 }
示例#18
0
 public void Empty_strands()
 {
     Assert.Equal(0, Hamming.Distance("", ""));
 }
示例#19
0
 public void Small_distance()
 {
     Assert.Equal(1, Hamming.Distance("GGACG", "GGTCG"));
 }
示例#20
0
 public void Large_distance_in_off_by_one_strand()
 {
     Assert.Equal(9, Hamming.Distance("GGACGGATTCTG", "AGGACGGATTCT"));
 }
示例#21
0
 public void Non_unique_character_in_first_strand()
 {
     Assert.Equal(1, Hamming.Distance("AAG", "AAA"));
 }
示例#22
0
 public void StaticTests(string a, string b, int expected)
 {
     Assert.AreEqual(expected, Hamming.Distance(a, b),
                     string.Format("Expected hamming distance of '{0}' and '{1}' to be {2}", a, b, expected));
 }