public static void Launch() { StringReverse.StringReverseTest(); //wywołuję metodę statyczną testującą klasę .cs LeapYear.LeapYearTest(); SumOfMultiples.SumOfMultiplesTest(); Raindrops.RaindropsTest(); NucleotideCount.NucleotideCountTest(); Accumulate.AccumulateTest(); }
public void Empty_strand() { var expected = new Dictionary <char, int> { ['A'] = 0, ['C'] = 0, ['G'] = 0, ['T'] = 0 }; Assert.Equal(expected, NucleotideCount.Count("")); }
public void Strand_with_multiple_nucleotides() { var expected = new Dictionary <char, int> { ['A'] = 20, ['C'] = 12, ['G'] = 17, ['T'] = 21 }; Assert.Equal(expected, NucleotideCount.Count("AGCTTTTCATTCTGACTGCAACGGGCAATATGTCTCTGTGTGGATTAAAAAAAGAGTGTCTGATAGCAGC")); }
public void Strand_with_repeated_nucleotide() { var expected = new Dictionary <char, int> { ['A'] = 0, ['C'] = 0, ['G'] = 7, ['T'] = 0 }; Assert.Equal(expected, NucleotideCount.Count("GGGGGGG")); }
public void Can_count_one_nucleotide_in_single_character_input() { var expected = new Dictionary <char, int> { ['A'] = 0, ['C'] = 0, ['G'] = 1, ['T'] = 0 }; Assert.Equal(expected, NucleotideCount.Count("G")); }
public void Count_MultipleDifferentNucleotides_CountsCorrectNucleotides() { var expected = new Dictionary <char, int> { ['A'] = 20, ['C'] = 12, ['G'] = 17, ['T'] = 21 }; Assert.AreEqual(expected, NucleotideCount.Count("AGCTTTTCATTCTGACTGCAACGGGCAATATGTCTCTGTGTGGATTAAAAAAAGAGTGTCTGATAGCAGC")); }
public void Strand_case_does_not_matter() { var expected = new Dictionary <char, int> { ['A'] = 2, ['C'] = 2, ['G'] = 2, ['T'] = 2 }; Assert.Equal(expected, NucleotideCount.Count("AaCcGgTt")); }
public void Count_MultipleRepeatNucleotides_CountsCorrectNucleotides() { var expected = new Dictionary <char, int> { ['A'] = 0, ['C'] = 0, ['G'] = 7, ['T'] = 0 }; Assert.AreEqual(expected, NucleotideCount.Count("GGGGGGG")); }
public void Count_OneNucleotide_CountsCorrectNucleotide() { var expected = new Dictionary <char, int> { ['A'] = 0, ['C'] = 0, ['G'] = 1, ['T'] = 0 }; Assert.AreEqual(expected, NucleotideCount.Count("G")); }
public void Count_EmptyStrand_CorrectResults() { var expected = new Dictionary <char, int> { ['A'] = 0, ['C'] = 0, ['G'] = 0, ['T'] = 0 }; Assert.AreEqual(expected, NucleotideCount.Count(string.Empty)); }
public static IDictionary <char, int> Count(string sequence) { if (sequence.Except(Nucleotides).Count() != 0) { throw new ArgumentException(); } var finalCount = sequence.Aggregate( NucleotideCount.Empty(), (count, nucleotide) => { count[nucleotide]++; return(count); } ); return(new ReadOnlyDictionary <char, int>(finalCount)); }
public void Strand_with_invalid_nucleotides() { Assert.Throws <ArgumentException>(() => NucleotideCount.Count("AGXXACT")); }
public void Count_InvalidNucleotides_ThrowsArgumentException() { Assert.Throws <ArgumentException>(() => NucleotideCount.Count("AGXXACT")); }