Skip to content

Commit 176d610

Browse files
add space-age
1 parent 2f21358 commit 176d610

File tree

3 files changed

+21
-24
lines changed

3 files changed

+21
-24
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
using Xunit;
2+
3+
public class SpaceAgeTests
4+
{
5+
{{#test_cases}}
6+
[Fact{{#unless @first}}(Skip = "Remove this Skip property to run this test"){{/unless}}]
7+
public void {{method_name path}}()
8+
{
9+
var sut = new SpaceAge({{input.seconds}});
10+
Assert.Equal({{expected}}, sut.On{{raw input.planet}}(), precision: 2);
11+
}
12+
{{/test_cases}}
13+
}

exercises/practice/space-age/SpaceAgeTests.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,56 +3,56 @@
33
public class SpaceAgeTests
44
{
55
[Fact]
6-
public void Age_on_earth()
6+
public void AgeOnEarth()
77
{
88
var sut = new SpaceAge(1000000000);
99
Assert.Equal(31.69, sut.OnEarth(), precision: 2);
1010
}
1111

1212
[Fact(Skip = "Remove this Skip property to run this test")]
13-
public void Age_on_mercury()
13+
public void AgeOnMercury()
1414
{
1515
var sut = new SpaceAge(2134835688);
1616
Assert.Equal(280.88, sut.OnMercury(), precision: 2);
1717
}
1818

1919
[Fact(Skip = "Remove this Skip property to run this test")]
20-
public void Age_on_venus()
20+
public void AgeOnVenus()
2121
{
2222
var sut = new SpaceAge(189839836);
2323
Assert.Equal(9.78, sut.OnVenus(), precision: 2);
2424
}
2525

2626
[Fact(Skip = "Remove this Skip property to run this test")]
27-
public void Age_on_mars()
27+
public void AgeOnMars()
2828
{
2929
var sut = new SpaceAge(2129871239);
3030
Assert.Equal(35.88, sut.OnMars(), precision: 2);
3131
}
3232

3333
[Fact(Skip = "Remove this Skip property to run this test")]
34-
public void Age_on_jupiter()
34+
public void AgeOnJupiter()
3535
{
3636
var sut = new SpaceAge(901876382);
3737
Assert.Equal(2.41, sut.OnJupiter(), precision: 2);
3838
}
3939

4040
[Fact(Skip = "Remove this Skip property to run this test")]
41-
public void Age_on_saturn()
41+
public void AgeOnSaturn()
4242
{
4343
var sut = new SpaceAge(2000000000);
4444
Assert.Equal(2.15, sut.OnSaturn(), precision: 2);
4545
}
4646

4747
[Fact(Skip = "Remove this Skip property to run this test")]
48-
public void Age_on_uranus()
48+
public void AgeOnUranus()
4949
{
5050
var sut = new SpaceAge(1210123456);
5151
Assert.Equal(0.46, sut.OnUranus(), precision: 2);
5252
}
5353

5454
[Fact(Skip = "Remove this Skip property to run this test")]
55-
public void Age_on_neptune()
55+
public void AgeOnNeptune()
5656
{
5757
var sut = new SpaceAge(1821023456);
5858
Assert.Equal(0.35, sut.OnNeptune(), precision: 2);

generators/Exercises/Generators/SpaceAge.cs

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

0 commit comments

Comments
 (0)