Permalink
Browse files

Game - remove MessageBus as ctor param

  • Loading branch information...
bobbymcr committed Nov 28, 2018
1 parent 809010a commit 5dfd996a5b1e2489f4e6642e924a37782b322d3f
Showing with 5 additions and 5 deletions.
  1. +3 −3 app/src/Game.cs
  2. +1 −1 app/src/Program.cs
  3. +1 −1 app/test/GameTest.cs
@@ -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()
@@ -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();
}
}
}
@@ -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));

0 comments on commit 5dfd996

Please sign in to comment.