Skip to content

Commit 2a93a85

Browse files
clock: add generator
1 parent 8341aa5 commit 2a93a85

File tree

2 files changed

+76
-114
lines changed

2 files changed

+76
-114
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{{ func clock
2+
$"new Clock({$0.hour}, {$0.minute})"
3+
end }}
4+
5+
using Xunit;
6+
7+
public class {{ testClass }}
8+
{
9+
{{- for test in tests }}
10+
[Fact{{ if !for.first }}(Skip = "Remove this Skip property to run this test"){{ end }}]
11+
public void {{ test.shortTestMethod }}()
12+
{
13+
{{- if test.property == "equal" }}
14+
Assert.{{ test.expected ? "Equal" : "NotEqual" }}({{ test.input.clock1 | clock }}, {{ test.input.clock2 | clock }});
15+
{{- else if test.property == "create" }}
16+
Assert.Equal({{ test.expected | string.literal }}, {{ test.input | clock }}.ToString());
17+
{{- else }}
18+
Assert.Equal({{ test.expected | string.literal }}, {{ test.input | clock }}.{{ test.testedMethod }}({{ test.input.value }}).ToString());
19+
{{ end -}}
20+
}
21+
{{ end -}}
22+
}

0 commit comments

Comments
 (0)