Skip to content

Commit a691db1

Browse files
word-count: add generator
1 parent 958fe34 commit a691db1

File tree

2 files changed

+20
-21
lines changed

2 files changed

+20
-21
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
using System.Collections.Generic;
2+
using Xunit;
3+
4+
public class WordCountTests
5+
{
6+
{{for testCase in testCases}}
7+
[Fact{{if !for.first}}(Skip = "Remove this Skip property to run this test"){{end}}]
8+
public void {{testCase.testMethodName}}()
9+
{
10+
var actual = WordCount.CountWords({{testCase.input.sentence | string.literal}});
11+
var expected = new Dictionary<string, int>
12+
{
13+
{{for key in testCase.expected | object.keys}}
14+
[{{key | string.literal}}] = {{testCase.expected[key]}}{{if !for.last}},{{end}}
15+
{{end}}
16+
};
17+
Assert.Equal(expected, actual);
18+
}
19+
{{end}}
20+
}

generators.deprecated/Exercises/Generators/WordCount.cs

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)