PowerShell - nucleotide-count

This commit is contained in:
Xevion
2021-11-26 02:30:19 -06:00
parent 596aa4f029
commit b6f26a5279
7 changed files with 158 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
BeforeAll {
. ".\NucleotideCount.ps1"
}
Describe "NucleotideCountTests" {
It "empty strand" {
Get-NucleotideCount -Strand "" | Should -BeExactly "A:0 C:0 G:0 T:0"
}
It "can count one nucleotide in single-character input" {
Get-NucleotideCount -Strand "G" | Should -BeExactly "A:0 C:0 G:1 T:0"
}
It "strand with repeated nucleotide" {
Get-NucleotideCount -Strand "GGGGGGG" | Should -BeExactly "A:0 C:0 G:7 T:0"
}
It "strand with multiple nucleotides" {
Get-NucleotideCount -Strand "AGCTTTTCATTCTGACTGCAACGGGCAATATGTCTCTGTGTGGATTAAAAAAAGAGTGTCTGATAGCAGC" | Should -BeExactly "A:20 C:12 G:17 T:21"
}
It "strand with invalid nucleotides" {
{ Get-NucleotideCount -Strand "AGXXACT" } | Should -Throw
}
}