コード例 #1
0
        public void GoodByeShouldPrintInTheConsoleProperMessage()
        {
            using (StringWriter sw = new StringWriter())
            {
                Console.SetOut(sw);

                String message = "GoodBye";
                manager.GoodBye(message);

                StringBuilder expected = new StringBuilder();
                expected.Append(Environment.NewLine);
                expected.Append(message);
                expected.Append(Environment.NewLine);
                Assert.AreEqual <string>(expected.ToString(), sw.ToString(), "Expected message from GoodBye method is not received.");
            }
        }