Skip to content

Commit a046e76

Browse files
triangle: simplify generator
1 parent d3bd5a3 commit a046e76

File tree

1 file changed

+2
-18
lines changed

1 file changed

+2
-18
lines changed

exercises/practice/triangle/.meta/Generator.tpl

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,11 @@ using Xunit;
22

33
public class TriangleTests
44
{
5-
{{for testCase in testCasesByProperty.equilateral}}
5+
{{for testCase in testCases}}
66
[Fact{{if !for.first}}(Skip = "Remove this Skip property to run this test"){{end}}]
77
public void {{testCase.testMethodName}}()
88
{
9-
Assert.{{testCase.expected ? "True" : "False"}}(Triangle.IsEquilateral({{testCase.input.sides | array.join ", "}}));
10-
}
11-
{{end}}
12-
13-
{{for testCase in testCasesByProperty.isosceles}}
14-
[Fact(Skip = "Remove this Skip property to run this test")]
15-
public void {{testCase.testMethodName}}()
16-
{
17-
Assert.{{testCase.expected ? "True" : "False"}}(Triangle.IsIsosceles({{testCase.input.sides | array.join ", "}}));
18-
}
19-
{{end}}
20-
21-
{{for testCase in testCasesByProperty.scalene}}
22-
[Fact(Skip = "Remove this Skip property to run this test")]
23-
public void {{testCase.testMethodName}}()
24-
{
25-
Assert.{{testCase.expected ? "True" : "False"}}(Triangle.IsScalene({{testCase.input.sides | array.join ", "}}));
9+
Assert.{{testCase.expected ? "True" : "False"}}(Triangle.Is{{testCase.property | string.capitalize}}({{testCase.input.sides | array.join ", "}}));
2610
}
2711
{{end}}
2812
}

0 commit comments

Comments
 (0)