TextLoggerTests ClassDelta Engine Documentation
Inheritance Hierarchy

System Object
  DeltaEngine.Logging.Tests TextLoggerTests

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

public class TextLoggerTests

The TextLoggerTests type exposes the following members.

Constructors

  NameDescription
Public methodTextLoggerTests
Initializes a new instance of the TextLoggerTests class
Top
Methods

  NameDescription
Public methodLogError
Public methodLogInfo
Public methodLogWarning
Top
Examples

[Test]
public void LogInfo()
{
    using (var logger = new TextLogger())
    {
        bool newLogMessageArrived = false;
        logger.NewLogMessage += () => newLogMessageArrived = true;
        Assert.IsFalse(newLogMessageArrived);
        Logger.Info("Message");
        Assert.IsTrue(newLogMessageArrived);
        Assert.IsTrue(logger.Log.EndsWith("Message"), logger.Log);
    }
}
[Test]
public void LogWarning()
{
    using (var logger = new TextLogger())
    {
        Logger.Warning("Warning");
        Logger.Warning(new WarningException(""));
        Assert.IsTrue(logger.Log.EndsWith(typeof(WarningException).ToString()), logger.Log);
    }
}
[Test]
public void LogError()
{
    using (var logger = new TextLogger())
    {
        Logger.Error(new TestError(""));
        Assert.IsTrue(logger.Log.Contains(typeof(TestError).ToString()), logger.Log);
    }
}
See Also