-
-
Notifications
You must be signed in to change notification settings - Fork 357
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
29d6fa9
commit 588d798
Showing
2 changed files
with
154 additions
and
250 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{{ func tuple | ||
ret $"({$0.column}, {$0.row})" | ||
end }} | ||
using Xunit; | ||
|
||
public class {{ testClass }} | ||
{ | ||
{{- for test in tests }} | ||
[Fact{{ if !for.first }}(Skip = "Remove this Skip property to run this test"){{ end }}] | ||
public void {{ test.testMethod }}() | ||
{ | ||
string[] wordsToSearchFor = {{ test.input.wordsToSearchFor }}; | ||
var grid = | ||
{{- for line in test.input.grid }} | ||
{{ if for.last -}} | ||
{{ line | string.literal -}}; | ||
{{- else -}} | ||
{{ line | string.append "\n" | string.literal }} + | ||
{{- end -}} | ||
{{- end }} | ||
var sut = new {{ testedClass }}(grid); | ||
var actual = sut.Search(wordsToSearchFor); | ||
{{- for key in test.expected | object.keys }} | ||
{{- if test.expected[key] }} | ||
Assert.Equal(({{ test.expected[key].start | tuple }}, {{ test.expected[key].end | tuple }}), actual[{{ key | string.literal }}]); | ||
{{- else }} | ||
Assert.Null(actual[{{ key | string.literal }}]); | ||
{{ end -}} | ||
{{ end -}} | ||
} | ||
{{ end -}} | ||
} |
Oops, something went wrong.