public void PrintStringEqual() { var consoleOutput = new StringWriter(); Console.SetOut(consoleOutput); const string TestString = "This is a test."; TestString.Print(); Assert.Equal(TestString + Environment.NewLine, consoleOutput.ToString()); }