public void WritesFormattedMessageToTextWriter(LogSeverity severity, string message, bool includeException, string expectedText)
        {
            StringWriter writer = new StringWriter();
            writer.NewLine = "\n";
            TextLogger logger = new TextLogger(writer);

            logger.Log(severity, message, includeException ? new Exception("Foo") : null);

            Assert.AreEqual(expectedText, writer.ToString());
        }
        public void WhenRuntimeVersionIsDotNet40_RunsInDotNet40()
        {
            if (DotNetRuntimeSupport.IsUsingMono)
                Assert.Inconclusive("This test makes no sense on Mono.");
            if (DotNetRuntimeSupport.InstalledDotNet40RuntimeVersion == null)
                Assert.Inconclusive("This test requires .Net 4.0 to be installed.");

            HostSetup hostSetup = new HostSetup();
            hostSetup.RuntimeVersion = DotNetRuntimeSupport.InstalledDotNet40RuntimeVersion;

            StringWriter writer = new StringWriter();
            TextLogger logger = new TextLogger(writer);
            using (IHost host = Factory.CreateHost(hostSetup, logger))
            {
            }

            Assert.Contains(writer.ToString(), "CLR " + DotNetRuntimeSupport.InstalledDotNet40RuntimeVersion);
        }