Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions nucleotide-count/Example.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,11 @@ private void InitializeNucleotideCounts(string sequence)

public int Count(char nucleotide)
{
if (IsUracil(nucleotide))
return 0;

int count;
if (!NucleotideCounts.TryGetValue(nucleotide, out count))
throw new InvalidNucleotideException();
return count;
}

private static bool IsUracil(char nucleotide)
{
return nucleotide == 'U';
}
}

public class InvalidNucleotideException : Exception { }
10 changes: 1 addition & 9 deletions nucleotide-count/NucleotideCountTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,6 @@ public void Counts_a_nucleotide_only_once()
Assert.That(dna.Count('T'), Is.EqualTo(2));
}

[Ignore]
[Test]
public void Has_no_uracil()
{
var dna = new DNA("GGTTGG");
Assert.That(dna.Count('U'), Is.EqualTo(0));
}

[Ignore]
[Test]
public void Validates_nucleotides()
Expand All @@ -78,4 +70,4 @@ public void Counts_all_nucleotides()
var expected = new Dictionary<char, int> { { 'A', 20 }, { 'T', 21 }, { 'C', 12 }, { 'G', 17 } };
Assert.That(dna.NucleotideCounts, Is.EqualTo(expected));
}
}
}