Skip to content

Commit 8ea9c56

Browse files
Update hello-world exercise (#206)
1 parent 3db90d4 commit 8ea9c56

File tree

2 files changed

+4
-21
lines changed

2 files changed

+4
-21
lines changed

exercises/hello-world/Example.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
public class HelloWorld
1+
public static class HelloWorld
22
{
3-
public static string Hello(string name)
4-
{
5-
return $"Hello, {name ?? "World"}!";
6-
}
3+
public static string Hello() => "Hello, World!";
74
}

exercises/hello-world/HelloWorldTest.cs

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,8 @@
44
public class HelloWorldTest
55
{
66
[Test]
7-
public void No_name()
7+
public void Say_hi()
88
{
9-
Assert.That(HelloWorld.Hello(null), Is.EqualTo("Hello, World!"));
10-
}
11-
12-
[Ignore("Remove to run test")]
13-
[Test]
14-
public void Sample_name()
15-
{
16-
Assert.That(HelloWorld.Hello("Alice"), Is.EqualTo("Hello, Alice!"));
17-
}
18-
19-
[Ignore("Remove to run test")]
20-
[Test]
21-
public void Other_sample_name()
22-
{
23-
Assert.That(HelloWorld.Hello("Bob"), Is.EqualTo("Hello, Bob!"));
9+
Assert.That(HelloWorld.Hello(), Is.EqualTo("Hello, World!"));
2410
}
2511
}

0 commit comments

Comments
 (0)