public void TestExit() { using (StringWriter strWriter = new StringWriter()) { Console.SetOut(strWriter); GameMessages.Exit(); string expected = string.Format("Goodbye!{0}", Environment.NewLine); Assert.AreEqual(expected, strWriter.ToString()); } }