Skip to content

Commit 29d6fa9

Browse files
nucleotide-count: add generator
1 parent 897ffe1 commit 29d6fa9

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using Xunit;
4+
5+
public class {{ testClass }}
6+
{
7+
{{- for test in tests }}
8+
[Fact{{ if !for.first }}(Skip = "Remove this Skip property to run this test"){{ end }}]
9+
public void {{ test.testMethod }}()
10+
{
11+
{{- if test.expected.error }}
12+
Assert.Throws<ArgumentException>(() => {{ testedClass }}.Count({{ test.input.strand | string.literal }}));
13+
{{ else }}
14+
var expected = new Dictionary<char, int>
15+
{
16+
{{- for key in test.expected | object.keys }}
17+
['{{ key }}'] = {{ test.expected[key] }}{{- if !for.last }},{{ end -}}
18+
{{ end -}}
19+
};
20+
Assert.Equal(expected, {{ testedClass }}.Count({{ test.input.strand | string.literal }}));
21+
{{ end -}}
22+
}
23+
{{ end -}}
24+
}

0 commit comments

Comments
 (0)