C# Class NLog.UnitTests.NLogTestBase

Mostrar archivo Open project: NLog/NLog

Public Methods

Method Description
CreateConfigurationFromString ( string configXml ) : XmlLoggingConfiguration
GetDebugTarget ( string targetName ) : NLog.Targets.DebugTarget

Protected Methods

Method Description
AssertDebugCounter ( string targetName, int val ) : void
AssertDebugLastMessage ( string targetName, string msg ) : void
AssertDebugLastMessageContains ( string targetName, string msg ) : void
AssertFileContains ( string fileName, string contentToCheck, Encoding encoding ) : void
AssertFileContents ( string fileName, string contents, Encoding encoding ) : void
AssertFileContents ( string fileName, string contents, Encoding encoding, bool addBom ) : void
AssertFileContentsEndsWith ( string fileName, string contents, Encoding encoding ) : void
AssertFileContentsStartsWith ( string fileName, string contents, Encoding encoding ) : void
AssertLayoutRendererOutput ( Layout layout, LogEventInfo logEventInfo, string expected ) : void

Render layout layout with logEventInfo and compare result with expected.

AssertLayoutRendererOutput ( Layout layout, string expected ) : void

Render layout layout with dummy LogEventInfoand compare result with expected.

AssertZipFileContents ( string fileName, string contents, Encoding encoding ) : void
GetCultureInfo ( string cultureName ) : CultureInfo

Creates CultureInfo instance for test purposes

Creates CultureInfo instance with non-userOverride flag to provide expected results when running tests in different system cultures(with overriden culture options)

GetDebugLastMessage ( string targetName ) : string
GetDebugLastMessage ( string targetName, LoggingConfiguration configuration ) : string
GetDebugTarget ( string targetName, LoggingConfiguration configuration ) : NLog.Targets.DebugTarget
GetPrevLineNumber ( ) : int

Get line number of previous line.

GetPrevLineNumber ( [ callingFileLineNumber ) : int

Get line number of previous line.

NLogTestBase ( ) : System.Linq
RunAndCaptureInternalLog ( SyncAction action, LogLevel internalLogLevel ) : string
StringRepeat ( int times, string s ) : string

Method Details

AssertDebugCounter() protected method

protected AssertDebugCounter ( string targetName, int val ) : void
targetName string
val int
return void

AssertDebugLastMessage() protected method

protected AssertDebugLastMessage ( string targetName, string msg ) : void
targetName string
msg string
return void

AssertDebugLastMessageContains() protected method

protected AssertDebugLastMessageContains ( string targetName, string msg ) : void
targetName string
msg string
return void

AssertFileContains() protected method

protected AssertFileContains ( string fileName, string contentToCheck, Encoding encoding ) : void
fileName string
contentToCheck string
encoding System.Text.Encoding
return void

AssertFileContents() protected method

protected AssertFileContents ( string fileName, string contents, Encoding encoding ) : void
fileName string
contents string
encoding System.Text.Encoding
return void

AssertFileContents() protected method

protected AssertFileContents ( string fileName, string contents, Encoding encoding, bool addBom ) : void
fileName string
contents string
encoding System.Text.Encoding
addBom bool
return void

AssertFileContentsEndsWith() protected method

protected AssertFileContentsEndsWith ( string fileName, string contents, Encoding encoding ) : void
fileName string
contents string
encoding System.Text.Encoding
return void

AssertFileContentsStartsWith() protected method

protected AssertFileContentsStartsWith ( string fileName, string contents, Encoding encoding ) : void
fileName string
contents string
encoding System.Text.Encoding
return void

AssertLayoutRendererOutput() protected static method

Render layout layout with logEventInfo and compare result with expected.
protected static AssertLayoutRendererOutput ( Layout layout, LogEventInfo logEventInfo, string expected ) : void
layout Layout
logEventInfo LogEventInfo
expected string
return void

AssertLayoutRendererOutput() protected static method

Render layout layout with dummy LogEventInfoand compare result with expected.
protected static AssertLayoutRendererOutput ( Layout layout, string expected ) : void
layout Layout
expected string
return void

AssertZipFileContents() protected method

protected AssertZipFileContents ( string fileName, string contents, Encoding encoding ) : void
fileName string
contents string
encoding System.Text.Encoding
return void

CreateConfigurationFromString() public static method

public static CreateConfigurationFromString ( string configXml ) : XmlLoggingConfiguration
configXml string
return XmlLoggingConfiguration

GetCultureInfo() protected static method

Creates CultureInfo instance for test purposes
Creates CultureInfo instance with non-userOverride flag to provide expected results when running tests in different system cultures(with overriden culture options)
protected static GetCultureInfo ( string cultureName ) : CultureInfo
cultureName string Culture name to create
return CultureInfo

GetDebugLastMessage() protected method

protected GetDebugLastMessage ( string targetName ) : string
targetName string
return string

GetDebugLastMessage() protected method

protected GetDebugLastMessage ( string targetName, LoggingConfiguration configuration ) : string
targetName string
configuration LoggingConfiguration
return string

GetDebugTarget() public method

public GetDebugTarget ( string targetName ) : NLog.Targets.DebugTarget
targetName string
return NLog.Targets.DebugTarget

GetDebugTarget() protected method

protected GetDebugTarget ( string targetName, LoggingConfiguration configuration ) : NLog.Targets.DebugTarget
targetName string
configuration LoggingConfiguration
return NLog.Targets.DebugTarget

GetPrevLineNumber() protected method

Get line number of previous line.
protected GetPrevLineNumber ( ) : int
return int

GetPrevLineNumber() protected method

Get line number of previous line.
protected GetPrevLineNumber ( [ callingFileLineNumber ) : int
callingFileLineNumber [
return int

NLogTestBase() protected method

protected NLogTestBase ( ) : System.Linq
return System.Linq

RunAndCaptureInternalLog() protected method

protected RunAndCaptureInternalLog ( SyncAction action, LogLevel internalLogLevel ) : string
action SyncAction
internalLogLevel LogLevel
return string

StringRepeat() protected method

protected StringRepeat ( int times, string s ) : string
times int
s string
return string