LoggerTests IfNoLoggerIsAttachedWeGetAWarning Method Delta Engine Documentation

Namespace: DeltaEngine.Tests.Core
Assembly: DeltaEngine.Tests (in DeltaEngine.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public void IfNoLoggerIsAttachedWeGetAWarning()
Examples

[Test]
public void IfNoLoggerIsAttachedWeGetAWarning()
{
    const string Warning = "Ohoh";
    const string Message = "No loggers have been created for this message: " + Warning;
    var defaultOut = Console.Out;
    var console = new StringWriter();
    Console.SetOut(console);
    Logger.Warning(Warning);
    Assert.IsTrue(console.ToString().Contains(Message), console.ToString());
    Console.SetOut(defaultOut);
    console.Dispose();
}
See Also