コード例 #1
0
        public void TestExerciseWhistleCreation()
        {
            using (StringWriter sw = new StringWriter())
            {
                // Save a reference to the standard output.
                TextWriter stdout = Console.Out;

                // Redirect standard output to variable.
                Console.SetOut(sw);

                Whistle Whistle = new Whistle("test");

                // Restore the original standard output.
                Console.SetOut(stdout);

                // Assert
                Assert.AreEqual(Whistle.GetType(), typeof(Whistle), "The Whistle should be able to be created with constructor call!");
            }
        }