Skip to content

Commit 4518b04

Browse files
roman-numerals: add generator
1 parent c141c66 commit 4518b04

File tree

2 files changed

+39
-27
lines changed

2 files changed

+39
-27
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
using Xunit;
2+
3+
public class {{testClass}}
4+
{
5+
{{for test in tests}}
6+
[Fact{{if !for.first}}(Skip = "Remove this Skip property to run this test"){{end}}]
7+
public void {{test.testMethod}}()
8+
{
9+
Assert.Equal({{test.expected | string.literal}}, {{test.input.number}}.To{{test.testedMethod}}());
10+
}
11+
{{end}}
12+
}

exercises/practice/roman-numerals/RomanNumeralsTests.cs

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,163 +3,163 @@
33
public class RomanNumeralsTests
44
{
55
[Fact]
6-
public void Number_1_is_i()
6+
public void One_is_i()
77
{
88
Assert.Equal("I", 1.ToRoman());
99
}
1010

1111
[Fact(Skip = "Remove this Skip property to run this test")]
12-
public void Number_2_is_ii()
12+
public void Two_is_ii()
1313
{
1414
Assert.Equal("II", 2.ToRoman());
1515
}
1616

1717
[Fact(Skip = "Remove this Skip property to run this test")]
18-
public void Number_3_is_iii()
18+
public void Three_is_iii()
1919
{
2020
Assert.Equal("III", 3.ToRoman());
2121
}
2222

2323
[Fact(Skip = "Remove this Skip property to run this test")]
24-
public void Number_4_is_iv()
24+
public void Four_is_iv()
2525
{
2626
Assert.Equal("IV", 4.ToRoman());
2727
}
2828

2929
[Fact(Skip = "Remove this Skip property to run this test")]
30-
public void Number_5_is_v()
30+
public void Five_is_v()
3131
{
3232
Assert.Equal("V", 5.ToRoman());
3333
}
3434

3535
[Fact(Skip = "Remove this Skip property to run this test")]
36-
public void Number_6_is_vi()
36+
public void Six_is_vi()
3737
{
3838
Assert.Equal("VI", 6.ToRoman());
3939
}
4040

4141
[Fact(Skip = "Remove this Skip property to run this test")]
42-
public void Number_9_is_ix()
42+
public void Nine_is_ix()
4343
{
4444
Assert.Equal("IX", 9.ToRoman());
4545
}
4646

4747
[Fact(Skip = "Remove this Skip property to run this test")]
48-
public void Number_16_is_xvi()
48+
public void Sixteen_is_xvi()
4949
{
5050
Assert.Equal("XVI", 16.ToRoman());
5151
}
5252

5353
[Fact(Skip = "Remove this Skip property to run this test")]
54-
public void Number_27_is_xxvii()
54+
public void Twenty_seven_is_xxvii()
5555
{
5656
Assert.Equal("XXVII", 27.ToRoman());
5757
}
5858

5959
[Fact(Skip = "Remove this Skip property to run this test")]
60-
public void Number_48_is_xlviii()
60+
public void Forty_eight_is_xlviii()
6161
{
6262
Assert.Equal("XLVIII", 48.ToRoman());
6363
}
6464

6565
[Fact(Skip = "Remove this Skip property to run this test")]
66-
public void Number_49_is_xlix()
66+
public void Forty_nine_is_xlix()
6767
{
6868
Assert.Equal("XLIX", 49.ToRoman());
6969
}
7070

7171
[Fact(Skip = "Remove this Skip property to run this test")]
72-
public void Number_59_is_lix()
72+
public void Fifty_nine_is_lix()
7373
{
7474
Assert.Equal("LIX", 59.ToRoman());
7575
}
7676

7777
[Fact(Skip = "Remove this Skip property to run this test")]
78-
public void Number_66_is_lxvi()
78+
public void Sixty_six_is_lxvi()
7979
{
8080
Assert.Equal("LXVI", 66.ToRoman());
8181
}
8282

8383
[Fact(Skip = "Remove this Skip property to run this test")]
84-
public void Number_93_is_xciii()
84+
public void Ninety_three_is_xciii()
8585
{
8686
Assert.Equal("XCIII", 93.ToRoman());
8787
}
8888

8989
[Fact(Skip = "Remove this Skip property to run this test")]
90-
public void Number_141_is_cxli()
90+
public void One_hundred_and_forty_one_is_cxli()
9191
{
9292
Assert.Equal("CXLI", 141.ToRoman());
9393
}
9494

9595
[Fact(Skip = "Remove this Skip property to run this test")]
96-
public void Number_163_is_clxiii()
96+
public void One_hundred_and_sixty_three_is_clxiii()
9797
{
9898
Assert.Equal("CLXIII", 163.ToRoman());
9999
}
100100

101101
[Fact(Skip = "Remove this Skip property to run this test")]
102-
public void Number_166_is_clxvi()
102+
public void One_hundred_and_sixty_six_is_clxvi()
103103
{
104104
Assert.Equal("CLXVI", 166.ToRoman());
105105
}
106106

107107
[Fact(Skip = "Remove this Skip property to run this test")]
108-
public void Number_402_is_cdii()
108+
public void Four_hundred_and_two_is_cdii()
109109
{
110110
Assert.Equal("CDII", 402.ToRoman());
111111
}
112112

113113
[Fact(Skip = "Remove this Skip property to run this test")]
114-
public void Number_575_is_dlxxv()
114+
public void Five_hundred_and_seventy_five_is_dlxxv()
115115
{
116116
Assert.Equal("DLXXV", 575.ToRoman());
117117
}
118118

119119
[Fact(Skip = "Remove this Skip property to run this test")]
120-
public void Number_666_is_dclxvi()
120+
public void Six_hundred_and_sixty_six_is_dclxvi()
121121
{
122122
Assert.Equal("DCLXVI", 666.ToRoman());
123123
}
124124

125125
[Fact(Skip = "Remove this Skip property to run this test")]
126-
public void Number_911_is_cmxi()
126+
public void Nine_hundred_and_eleven_is_cmxi()
127127
{
128128
Assert.Equal("CMXI", 911.ToRoman());
129129
}
130130

131131
[Fact(Skip = "Remove this Skip property to run this test")]
132-
public void Number_1024_is_mxxiv()
132+
public void One_thousand_and_twenty_four_is_mxxiv()
133133
{
134134
Assert.Equal("MXXIV", 1024.ToRoman());
135135
}
136136

137137
[Fact(Skip = "Remove this Skip property to run this test")]
138-
public void Number_1666_is_mdclxvi()
138+
public void One_thousand_six_hundred_and_sixty_six_is_mdclxvi()
139139
{
140140
Assert.Equal("MDCLXVI", 1666.ToRoman());
141141
}
142142

143143
[Fact(Skip = "Remove this Skip property to run this test")]
144-
public void Number_3000_is_mmm()
144+
public void Three_thousand_is_mmm()
145145
{
146146
Assert.Equal("MMM", 3000.ToRoman());
147147
}
148148

149149
[Fact(Skip = "Remove this Skip property to run this test")]
150-
public void Number_3001_is_mmmi()
150+
public void Three_thousand_and_one_is_mmmi()
151151
{
152152
Assert.Equal("MMMI", 3001.ToRoman());
153153
}
154154

155155
[Fact(Skip = "Remove this Skip property to run this test")]
156-
public void Number_3888_is_mmmdccclxxxviii()
156+
public void Three_thousand_eight_hundred_and_eighty_eight_is_mmmdccclxxxviii()
157157
{
158158
Assert.Equal("MMMDCCCLXXXVIII", 3888.ToRoman());
159159
}
160160

161161
[Fact(Skip = "Remove this Skip property to run this test")]
162-
public void Number_3999_is_mmmcmxcix()
162+
public void Three_thousand_nine_hundred_and_ninety_nine_is_mmmcmxcix()
163163
{
164164
Assert.Equal("MMMCMXCIX", 3999.ToRoman());
165165
}

0 commit comments

Comments
 (0)