public void CreatePlayer() { game = new Game(); input = new StubTextReader(); output = new StringWriter(); player = new HumanPlayer(game, input, output); }
public void ReadLineReturnsFirstLineOfWhatWasWritten() { var reader = new StubTextReader(); reader.WriteLine("First Line"); reader.WriteLine("Second Line"); Assert.That(reader.ReadLine(), Is.EqualTo("First Line")); }
public void ReadLineRemembersWhatWasAlreadyRead() { var reader = new StubTextReader(); reader.WriteLine("First Line"); reader.WriteLine("Second Line"); reader.ReadLine(); Assert.That(reader.ReadLine(), Is.EqualTo("Second Line")); }
public void CreateUI() { input = new StubTextReader(); output = new StringWriter(); ui = new ConsoleUI(input, output); }
public void ReadLineReturnsEmptyStringIfNothingWritten() { var reader = new StubTextReader(); Assert.That(reader.ReadLine(), Is.EqualTo("")); }