Skip to content

Commit

Permalink
Game - remove MessageBus as ctor param
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbymcr committed Nov 28, 2018
1 parent 809010a commit 5dfd996
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions app/src/Game.cs
Expand Up @@ -11,10 +11,10 @@ public sealed class Game
private readonly MessageBus bus;
private readonly TextConsole console;

public Game(MessageBus bus, TextReader reader, TextWriter writer)
public Game(TextReader reader, TextWriter writer)
{
this.bus = bus;
this.console = new TextConsole(bus, reader, writer);
this.bus = new MessageBus();
this.console = new TextConsole(this.bus, reader, writer);
}

public void Run()
Expand Down
2 changes: 1 addition & 1 deletion app/src/Program.cs
Expand Up @@ -10,7 +10,7 @@ internal static class Program
{
private static void Main()
{
new Game(new MessageBus(), Console.In, Console.Out).Run();
new Game(Console.In, Console.Out).Run();
}
}
}
2 changes: 1 addition & 1 deletion app/test/GameTest.cs
Expand Up @@ -19,7 +19,7 @@ public void WalkthroughTest()
using (StreamReader reader = new StreamReader("walkthrough.in"))
using (StreamWriter writer = new StreamWriter(ActualOut))
{
new Game(new MessageBus(), reader, writer).Run();
new Game(reader, writer).Run();
}

File.ReadAllLines(ActualOut).Should().Equal(File.ReadAllLines(ExpectedOut));
Expand Down

0 comments on commit 5dfd996

Please sign in to comment.