public override void Arrange() { _config = AppConfig.ChangeByResource(this, "App.config"); Trace.Refresh(); LogConfig.DisableAutoConfig = true; if (LogConfig.IsConfigured) { LogConfig.Reset(); } ClientMock = new LogCastClientMock(); LogConfig.BeginConfiguration(new TraceLogManager(TestTraceSource)) .WithLogCastClientFactory(new LogCastClientFactoryMock(ClientMock)) .End(); Logger = LogManager.GetLogger(); if (Listener == null) { Listener = GetListener(TestTraceSource); } ClientMock.Options = Listener.Worker.Options; ClientMock.LastLog = null; ClientMock.LastWaitAll = null; ClientMock.WaitAllTimeout = TimeSpan.FromMilliseconds(10); }
public override void Arrange() { _config = AppConfig.ChangeByResource(this, "App.config"); global::NLog.LogManager.ReconfigExistingLoggers(); LogConfig.DisableAutoConfig = true; if (LogConfig.IsConfigured) { LogConfig.Reset(); } ClientMock = new LogCastClientMock(); LogConfig.BeginConfiguration(new NLogManager()) .WithLogCastClientFactory(new LogCastClientFactoryMock(ClientMock)) .End(); Logger = LogManager.GetLogger(); if (Target == null) { Target = NLogManager.GetTarget(); } ClientMock.Options = Target.Options; ClientMock.LastLog = null; ClientMock.LastWaitAll = null; ClientMock.WaitAllTimeout = TimeSpan.FromSeconds(1); }
public override void Arrange() { _config = AppConfig.ChangeByResource(this, "App.config"); LogConfig.DisableAutoConfig = true; if (LogConfig.IsConfigured) { LogConfig.Reset(); } Target = new DirectLogManager(); var clientFactory = new LogCastClientFactoryMock(); LogConfig.BeginConfiguration(Target) .WithLogCastClientFactory(clientFactory) .End(); ClientMock = clientFactory.ConfiguredClient; ClientMock.LastLog = null; ClientMock.LastWaitAll = null; ClientMock.WaitAllTimeout = TimeSpan.FromSeconds(1); Logger = LogManager.GetLogger(); }
public override void Arrange() { LogConfig.Reset(); LogConfig.DisableAutoConfig = true; }
public override void Cleanup() { LogConfig.Reset(); LogConfig.DisableAutoConfig = false; }
//-------------------------------------------------------- public void ClearLogConfig() { LogConfig.Reset(); }