Exemple #1
0
        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);
        }
Exemple #2
0
        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);
        }
Exemple #3
0
        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();
        }
Exemple #4
0
 public override void Arrange()
 {
     LogConfig.Reset();
     LogConfig.DisableAutoConfig = true;
 }
Exemple #5
0
 public override void Cleanup()
 {
     LogConfig.Reset();
     LogConfig.DisableAutoConfig = false;
 }
Exemple #6
0
        //--------------------------------------------------------

        public void ClearLogConfig()
        {
            LogConfig.Reset();
        }