public void ForwardingLoggingShowCommandLine()
        {
            EventSourceSink source = new EventSourceSink();

            TestForwardingLogger logger = new TestForwardingLogger
            {
                BuildEventRedirector = null,
                Verbosity            = LoggerVerbosity.Normal,
                Parameters           = "SHOWCOMMANDLINE"
            };

            logger.Initialize(source, 4);

            RaiseEvents(source);

            logger.ForwardedEvents.ShouldBe(new BuildEventArgs[]
            {
                _buildStarted,
                _projectStarted,
                _targetStarted,
                _normalMessage,
                _highMessage,
                _commandLine,
                _warning,
                _error,
                _targetFinished,
                _projectFinished,
                _buildFinished,
            });
        }
        public void ForwardingLoggingPerformanceSummary()
        {
            EventSourceSink source = new EventSourceSink();

            TestForwardingLogger logger = new TestForwardingLogger
            {
                BuildEventRedirector = null,
                Parameters           = "PERFORMANCESUMMARY",
                Verbosity            = LoggerVerbosity.Quiet
            };

            logger.Initialize(source, 4);

            RaiseEvents(source);

            logger.ForwardedEvents.ShouldBe(new BuildEventArgs[]
            {
                _buildStarted,
                _projectStarted,
                _targetStarted,
                _taskStarted,
                _warning,
                _error,
                _taskFinished,
                _targetFinished,
                _projectFinished,
                _buildFinished,
            });
        }
        public void ForwardingLoggingNoSummary()
        {
            EventSource          source = new EventSource();
            TestForwardingLogger logger = new TestForwardingLogger();

            logger.BuildEventRedirector = null;
            logger.Verbosity            = LoggerVerbosity.Normal;
            logger.Parameters           = "NOSUMMARY";
            logger.Initialize(source, 4);
            RaiseEvents(source);
            Assert.IsTrue(logger.forwardedEvents.Count == 8);
            Assert.IsTrue(logger.forwardedEvents.Contains(error));
            Assert.IsTrue(logger.forwardedEvents.Contains(warning));
            Assert.IsTrue(logger.forwardedEvents.Contains(highMessage));
            Assert.IsTrue(logger.forwardedEvents.Contains(normalMessage));
            Assert.IsTrue(logger.forwardedEvents.Contains(projectStarted));
            Assert.IsTrue(logger.forwardedEvents.Contains(projectFinished));
            Assert.IsTrue(logger.forwardedEvents.Contains(targetStarted));
            Assert.IsTrue(logger.forwardedEvents.Contains(targetFinished));
        }
        public void ForwardingLoggingPerformanceSummary()
        {
            EventSource          source = new EventSource();
            TestForwardingLogger logger = new TestForwardingLogger();

            logger.BuildEventRedirector = null;
            logger.Parameters           = "PERFORMANCESUMMARY";
            logger.Verbosity            = LoggerVerbosity.Quiet;
            logger.Initialize(source, 4);
            RaiseEvents(source);
            Assert.IsTrue(logger.forwardedEvents.Count == 8);
            Assert.IsTrue(logger.forwardedEvents.Contains(error));
            Assert.IsTrue(logger.forwardedEvents.Contains(warning));
            Assert.IsTrue(logger.forwardedEvents.Contains(projectStarted));
            Assert.IsTrue(logger.forwardedEvents.Contains(projectFinished));
            Assert.IsTrue(logger.forwardedEvents.Contains(targetStarted));
            Assert.IsTrue(logger.forwardedEvents.Contains(targetFinished));
            Assert.IsTrue(logger.forwardedEvents.Contains(taskStarted));
            Assert.IsTrue(logger.forwardedEvents.Contains(taskFinished));
        }
Exemplo n.º 5
0
        public void ForwardingLoggingShowCommandLine()
        {
            EventSourceSink      source = new EventSourceSink();
            TestForwardingLogger logger = new TestForwardingLogger();

            logger.BuildEventRedirector = null;
            logger.Verbosity            = LoggerVerbosity.Normal;
            logger.Parameters           = "SHOWCOMMANDLINE";
            logger.Initialize(source, 4);
            RaiseEvents(source);
            Assert.Equal(11, logger.forwardedEvents.Count);
            Assert.True(logger.forwardedEvents.Contains(_buildStarted));
            Assert.True(logger.forwardedEvents.Contains(_buildFinished));
            Assert.True(logger.forwardedEvents.Contains(_error));
            Assert.True(logger.forwardedEvents.Contains(_warning));
            Assert.True(logger.forwardedEvents.Contains(_highMessage));
            Assert.True(logger.forwardedEvents.Contains(_normalMessage));
            Assert.True(logger.forwardedEvents.Contains(_projectStarted));
            Assert.True(logger.forwardedEvents.Contains(_projectFinished));
            Assert.True(logger.forwardedEvents.Contains(_targetStarted));
            Assert.True(logger.forwardedEvents.Contains(_targetFinished));
            Assert.True(logger.forwardedEvents.Contains(_commandLine));
        }
        public void ForwardingLoggingEventsBasedOnVerbosity(LoggerVerbosity?loggerVerbosity)
        {
            EventSourceSink      source = new EventSourceSink();
            TestForwardingLogger logger = new TestForwardingLogger
            {
                BuildEventRedirector = null
            };

            if (loggerVerbosity.HasValue)
            {
                logger.Verbosity = loggerVerbosity.Value;
            }
            else
            {
                // Testing a single event when verbosity is not set
                logger.Parameters = "BUILDSTARTEDEVENT";
            }

            logger.Initialize(source, 4);
            RaiseEvents(source);

            switch (loggerVerbosity)
            {
            case null:
                logger.ForwardedEvents.ShouldBe(new BuildEventArgs[] { _buildStarted });
                break;

            case LoggerVerbosity.Quiet:
                logger.ForwardedEvents.ShouldBe(new BuildEventArgs[]
                {
                    _buildStarted,
                    _warning,
                    _error,
                    _buildFinished
                });
                break;

            case LoggerVerbosity.Minimal:
                logger.ForwardedEvents.ShouldBe(new BuildEventArgs[]
                {
                    _buildStarted,
                    _highMessage,
                    _warning,
                    _error,
                    _buildFinished
                });
                break;

            case LoggerVerbosity.Normal:
                logger.ForwardedEvents.ShouldBe(new BuildEventArgs[]
                {
                    _buildStarted,
                    _projectStarted,
                    _targetStarted,
                    _normalMessage,
                    _highMessage,
                    _commandLine,
                    _warning,
                    _error,
                    _targetFinished,
                    _projectFinished,
                    _buildFinished,
                });
                break;

            case LoggerVerbosity.Detailed:
                logger.ForwardedEvents.ShouldBe(new BuildEventArgs[]
                {
                    _buildStarted,
                    _projectStarted,
                    _targetStarted,
                    _taskStarted,
                    _lowMessage,
                    _normalMessage,
                    _highMessage,
                    _commandLine,
                    _warning,
                    _error,
                    _taskFinished,
                    _targetFinished,
                    _projectFinished,
                    _buildFinished,
                });
                break;

            case LoggerVerbosity.Diagnostic:
                logger.ForwardedEvents.ShouldBe(new BuildEventArgs[]
                {
                    _buildStarted,
                    _projectStarted,
                    _targetStarted,
                    _taskStarted,
                    _lowMessage,
                    _normalMessage,
                    _highMessage,
                    _commandLine,
                    _externalStartedEvent,
                    _warning,
                    _error,
                    _taskFinished,
                    _targetFinished,
                    _projectFinished,
                    _buildFinished,
                });
                break;
            }
        }
        public void ForwardingLoggingEventsBasedOnVerbosity()
        {
            EventSourceSink source = new EventSourceSink();
            TestForwardingLogger logger = new TestForwardingLogger();
            logger.BuildEventRedirector = null;
            logger.Parameters = "BUILDSTARTEDEVENT";
            logger.Initialize(source, 4);
            RaiseEvents(source);
            Assert.IsTrue(logger.forwardedEvents.Count == 1);

            logger = new TestForwardingLogger();
            logger.BuildEventRedirector = null;
            logger.Verbosity = LoggerVerbosity.Quiet;
            logger.Initialize(source, 4);
            RaiseEvents(source);
            Assert.IsTrue(logger.forwardedEvents.Count == 4);
            Assert.IsTrue(logger.forwardedEvents.Contains(s_buildStarted));
            Assert.IsTrue(logger.forwardedEvents.Contains(s_buildFinished));
            Assert.IsTrue(logger.forwardedEvents.Contains(s_error));
            Assert.IsTrue(logger.forwardedEvents.Contains(s_warning));

            logger = new TestForwardingLogger();
            logger.BuildEventRedirector = null;
            logger.Verbosity = LoggerVerbosity.Minimal;
            logger.Initialize(source, 4);
            RaiseEvents(source);
            Assert.IsTrue(logger.forwardedEvents.Count == 5);
            Assert.IsTrue(logger.forwardedEvents.Contains(s_buildStarted));
            Assert.IsTrue(logger.forwardedEvents.Contains(s_buildFinished));
            Assert.IsTrue(logger.forwardedEvents.Contains(s_error));
            Assert.IsTrue(logger.forwardedEvents.Contains(s_warning));
            Assert.IsTrue(logger.forwardedEvents.Contains(s_highMessage));

            logger = new TestForwardingLogger();
            logger.BuildEventRedirector = null;
            logger.Verbosity = LoggerVerbosity.Normal;
            logger.Initialize(source, 4);
            RaiseEvents(source);
            Assert.IsTrue(logger.forwardedEvents.Count == 11);
            Assert.IsTrue(logger.forwardedEvents.Contains(s_buildStarted));
            Assert.IsTrue(logger.forwardedEvents.Contains(s_buildFinished));
            Assert.IsTrue(logger.forwardedEvents.Contains(s_error));
            Assert.IsTrue(logger.forwardedEvents.Contains(s_warning));
            Assert.IsTrue(logger.forwardedEvents.Contains(s_highMessage));
            Assert.IsTrue(logger.forwardedEvents.Contains(s_normalMessage));
            Assert.IsTrue(logger.forwardedEvents.Contains(s_projectStarted));
            Assert.IsTrue(logger.forwardedEvents.Contains(s_projectFinished));
            Assert.IsTrue(logger.forwardedEvents.Contains(s_targetStarted));
            Assert.IsTrue(logger.forwardedEvents.Contains(s_targetFinished));
            Assert.IsTrue(logger.forwardedEvents.Contains(s_commandLine));

            logger = new TestForwardingLogger();
            logger.BuildEventRedirector = null;
            logger.Verbosity = LoggerVerbosity.Detailed;
            logger.Initialize(source, 4);
            RaiseEvents(source);
            Assert.IsTrue(logger.forwardedEvents.Count == 14);
            Assert.IsTrue(logger.forwardedEvents.Contains(s_buildStarted));
            Assert.IsTrue(logger.forwardedEvents.Contains(s_buildFinished));
            Assert.IsTrue(logger.forwardedEvents.Contains(s_error));
            Assert.IsTrue(logger.forwardedEvents.Contains(s_warning));
            Assert.IsTrue(logger.forwardedEvents.Contains(s_highMessage));
            Assert.IsTrue(logger.forwardedEvents.Contains(s_lowMessage));
            Assert.IsTrue(logger.forwardedEvents.Contains(s_normalMessage));
            Assert.IsTrue(logger.forwardedEvents.Contains(s_projectStarted));
            Assert.IsTrue(logger.forwardedEvents.Contains(s_projectFinished));
            Assert.IsTrue(logger.forwardedEvents.Contains(s_targetStarted));
            Assert.IsTrue(logger.forwardedEvents.Contains(s_targetFinished));
            Assert.IsTrue(logger.forwardedEvents.Contains(s_taskStarted));
            Assert.IsTrue(logger.forwardedEvents.Contains(s_taskFinished));
            Assert.IsTrue(logger.forwardedEvents.Contains(s_commandLine));

            logger = new TestForwardingLogger();
            logger.BuildEventRedirector = null;
            logger.Verbosity = LoggerVerbosity.Diagnostic;
            logger.Initialize(source, 4);
            RaiseEvents(source);
            Assert.IsTrue(logger.forwardedEvents.Count == 15);
            Assert.IsTrue(logger.forwardedEvents.Contains(s_buildStarted));
            Assert.IsTrue(logger.forwardedEvents.Contains(s_buildFinished));
            Assert.IsTrue(logger.forwardedEvents.Contains(s_error));
            Assert.IsTrue(logger.forwardedEvents.Contains(s_warning));
            Assert.IsTrue(logger.forwardedEvents.Contains(s_highMessage));
            Assert.IsTrue(logger.forwardedEvents.Contains(s_lowMessage));
            Assert.IsTrue(logger.forwardedEvents.Contains(s_normalMessage));
            Assert.IsTrue(logger.forwardedEvents.Contains(s_projectStarted));
            Assert.IsTrue(logger.forwardedEvents.Contains(s_projectFinished));
            Assert.IsTrue(logger.forwardedEvents.Contains(s_targetStarted));
            Assert.IsTrue(logger.forwardedEvents.Contains(s_targetFinished));
            Assert.IsTrue(logger.forwardedEvents.Contains(s_taskStarted));
            Assert.IsTrue(logger.forwardedEvents.Contains(s_taskFinished));
            Assert.IsTrue(logger.forwardedEvents.Contains(s_externalStartedEvent));
            Assert.IsTrue(logger.forwardedEvents.Contains(s_commandLine));
        }
 public void ForwardingLoggingShowCommandLine()
 {
     EventSourceSink source = new EventSourceSink();
     TestForwardingLogger logger = new TestForwardingLogger();
     logger.BuildEventRedirector = null;
     logger.Verbosity = LoggerVerbosity.Normal;
     logger.Parameters = "SHOWCOMMANDLINE";
     logger.Initialize(source, 4);
     RaiseEvents(source);
     Assert.IsTrue(logger.forwardedEvents.Count == 11);
     Assert.IsTrue(logger.forwardedEvents.Contains(s_buildStarted));
     Assert.IsTrue(logger.forwardedEvents.Contains(s_buildFinished));
     Assert.IsTrue(logger.forwardedEvents.Contains(s_error));
     Assert.IsTrue(logger.forwardedEvents.Contains(s_warning));
     Assert.IsTrue(logger.forwardedEvents.Contains(s_highMessage));
     Assert.IsTrue(logger.forwardedEvents.Contains(s_normalMessage));
     Assert.IsTrue(logger.forwardedEvents.Contains(s_projectStarted));
     Assert.IsTrue(logger.forwardedEvents.Contains(s_projectFinished));
     Assert.IsTrue(logger.forwardedEvents.Contains(s_targetStarted));
     Assert.IsTrue(logger.forwardedEvents.Contains(s_targetFinished));
     Assert.IsTrue(logger.forwardedEvents.Contains(s_commandLine));
 }
 public void ForwardingLoggingPerformanceSummary()
 {
     EventSourceSink source = new EventSourceSink();
     TestForwardingLogger logger = new TestForwardingLogger();
     logger.BuildEventRedirector = null;
     logger.Parameters = "PERFORMANCESUMMARY";
     logger.Verbosity = LoggerVerbosity.Quiet;
     logger.Initialize(source, 4);
     RaiseEvents(source);
     Assert.IsTrue(logger.forwardedEvents.Count == 10);
     Assert.IsTrue(logger.forwardedEvents.Contains(s_buildStarted));
     Assert.IsTrue(logger.forwardedEvents.Contains(s_buildFinished));
     Assert.IsTrue(logger.forwardedEvents.Contains(s_error));
     Assert.IsTrue(logger.forwardedEvents.Contains(s_warning));
     Assert.IsTrue(logger.forwardedEvents.Contains(s_projectStarted));
     Assert.IsTrue(logger.forwardedEvents.Contains(s_projectFinished));
     Assert.IsTrue(logger.forwardedEvents.Contains(s_targetStarted));
     Assert.IsTrue(logger.forwardedEvents.Contains(s_targetFinished));
     Assert.IsTrue(logger.forwardedEvents.Contains(s_taskStarted));
     Assert.IsTrue(logger.forwardedEvents.Contains(s_taskFinished));
 }
Exemplo n.º 10
0
        public void ForwardingLoggingEventsBasedOnVerbosity()
        {
            EventSourceSink      source = new EventSourceSink();
            TestForwardingLogger logger = new TestForwardingLogger();

            logger.BuildEventRedirector = null;
            logger.Parameters           = "BUILDSTARTEDEVENT";
            logger.Initialize(source, 4);
            RaiseEvents(source);
            Assert.Equal(1, logger.forwardedEvents.Count);

            logger = new TestForwardingLogger();
            logger.BuildEventRedirector = null;
            logger.Verbosity            = LoggerVerbosity.Quiet;
            logger.Initialize(source, 4);
            RaiseEvents(source);
            Assert.Equal(4, logger.forwardedEvents.Count);
            Assert.True(logger.forwardedEvents.Contains(_buildStarted));
            Assert.True(logger.forwardedEvents.Contains(_buildFinished));
            Assert.True(logger.forwardedEvents.Contains(_error));
            Assert.True(logger.forwardedEvents.Contains(_warning));

            logger = new TestForwardingLogger();
            logger.BuildEventRedirector = null;
            logger.Verbosity            = LoggerVerbosity.Minimal;
            logger.Initialize(source, 4);
            RaiseEvents(source);
            Assert.Equal(5, logger.forwardedEvents.Count);
            Assert.True(logger.forwardedEvents.Contains(_buildStarted));
            Assert.True(logger.forwardedEvents.Contains(_buildFinished));
            Assert.True(logger.forwardedEvents.Contains(_error));
            Assert.True(logger.forwardedEvents.Contains(_warning));
            Assert.True(logger.forwardedEvents.Contains(_highMessage));

            logger = new TestForwardingLogger();
            logger.BuildEventRedirector = null;
            logger.Verbosity            = LoggerVerbosity.Normal;
            logger.Initialize(source, 4);
            RaiseEvents(source);
            Assert.Equal(11, logger.forwardedEvents.Count);
            Assert.True(logger.forwardedEvents.Contains(_buildStarted));
            Assert.True(logger.forwardedEvents.Contains(_buildFinished));
            Assert.True(logger.forwardedEvents.Contains(_error));
            Assert.True(logger.forwardedEvents.Contains(_warning));
            Assert.True(logger.forwardedEvents.Contains(_highMessage));
            Assert.True(logger.forwardedEvents.Contains(_normalMessage));
            Assert.True(logger.forwardedEvents.Contains(_projectStarted));
            Assert.True(logger.forwardedEvents.Contains(_projectFinished));
            Assert.True(logger.forwardedEvents.Contains(_targetStarted));
            Assert.True(logger.forwardedEvents.Contains(_targetFinished));
            Assert.True(logger.forwardedEvents.Contains(_commandLine));

            logger = new TestForwardingLogger();
            logger.BuildEventRedirector = null;
            logger.Verbosity            = LoggerVerbosity.Detailed;
            logger.Initialize(source, 4);
            RaiseEvents(source);
            Assert.Equal(14, logger.forwardedEvents.Count);
            Assert.True(logger.forwardedEvents.Contains(_buildStarted));
            Assert.True(logger.forwardedEvents.Contains(_buildFinished));
            Assert.True(logger.forwardedEvents.Contains(_error));
            Assert.True(logger.forwardedEvents.Contains(_warning));
            Assert.True(logger.forwardedEvents.Contains(_highMessage));
            Assert.True(logger.forwardedEvents.Contains(_lowMessage));
            Assert.True(logger.forwardedEvents.Contains(_normalMessage));
            Assert.True(logger.forwardedEvents.Contains(_projectStarted));
            Assert.True(logger.forwardedEvents.Contains(_projectFinished));
            Assert.True(logger.forwardedEvents.Contains(_targetStarted));
            Assert.True(logger.forwardedEvents.Contains(_targetFinished));
            Assert.True(logger.forwardedEvents.Contains(_taskStarted));
            Assert.True(logger.forwardedEvents.Contains(_taskFinished));
            Assert.True(logger.forwardedEvents.Contains(_commandLine));

            logger = new TestForwardingLogger();
            logger.BuildEventRedirector = null;
            logger.Verbosity            = LoggerVerbosity.Diagnostic;
            logger.Initialize(source, 4);
            RaiseEvents(source);
            Assert.Equal(15, logger.forwardedEvents.Count);
            Assert.True(logger.forwardedEvents.Contains(_buildStarted));
            Assert.True(logger.forwardedEvents.Contains(_buildFinished));
            Assert.True(logger.forwardedEvents.Contains(_error));
            Assert.True(logger.forwardedEvents.Contains(_warning));
            Assert.True(logger.forwardedEvents.Contains(_highMessage));
            Assert.True(logger.forwardedEvents.Contains(_lowMessage));
            Assert.True(logger.forwardedEvents.Contains(_normalMessage));
            Assert.True(logger.forwardedEvents.Contains(_projectStarted));
            Assert.True(logger.forwardedEvents.Contains(_projectFinished));
            Assert.True(logger.forwardedEvents.Contains(_targetStarted));
            Assert.True(logger.forwardedEvents.Contains(_targetFinished));
            Assert.True(logger.forwardedEvents.Contains(_taskStarted));
            Assert.True(logger.forwardedEvents.Contains(_taskFinished));
            Assert.True(logger.forwardedEvents.Contains(_externalStartedEvent));
            Assert.True(logger.forwardedEvents.Contains(_commandLine));
        }
Exemplo n.º 11
0
        public void ForwardingLoggingEventsBasedOnVerbosity()
        {
            EventSource          source = new EventSource();
            TestForwardingLogger logger = new TestForwardingLogger();

            logger.BuildEventRedirector = null;
            logger.Parameters           = "BUILDSTARTEDEVENT";
            logger.Initialize(source, 4);
            RaiseEvents(source);
            Assert.IsTrue(logger.forwardedEvents.Count == 1);

            logger = new TestForwardingLogger();
            logger.BuildEventRedirector = null;
            logger.Verbosity            = LoggerVerbosity.Quiet;
            logger.Initialize(source, 4);
            RaiseEvents(source);
            Assert.IsTrue(logger.forwardedEvents.Count == 2);
            Assert.IsTrue(logger.forwardedEvents.Contains(error));
            Assert.IsTrue(logger.forwardedEvents.Contains(warning));

            logger = new TestForwardingLogger();
            logger.BuildEventRedirector = null;
            logger.Verbosity            = LoggerVerbosity.Minimal;
            logger.Initialize(source, 4);
            RaiseEvents(source);
            Assert.IsTrue(logger.forwardedEvents.Count == 3);
            Assert.IsTrue(logger.forwardedEvents.Contains(error));
            Assert.IsTrue(logger.forwardedEvents.Contains(warning));
            Assert.IsTrue(logger.forwardedEvents.Contains(highMessage));

            logger = new TestForwardingLogger();
            logger.BuildEventRedirector = null;
            logger.Verbosity            = LoggerVerbosity.Normal;
            logger.Initialize(source, 4);
            RaiseEvents(source);
            Assert.IsTrue(logger.forwardedEvents.Count == 8);
            Assert.IsTrue(logger.forwardedEvents.Contains(error));
            Assert.IsTrue(logger.forwardedEvents.Contains(warning));
            Assert.IsTrue(logger.forwardedEvents.Contains(highMessage));
            Assert.IsTrue(logger.forwardedEvents.Contains(normalMessage));
            Assert.IsTrue(logger.forwardedEvents.Contains(projectStarted));
            Assert.IsTrue(logger.forwardedEvents.Contains(projectFinished));
            Assert.IsTrue(logger.forwardedEvents.Contains(targetStarted));
            Assert.IsTrue(logger.forwardedEvents.Contains(targetFinished));

            logger = new TestForwardingLogger();
            logger.BuildEventRedirector = null;
            logger.Verbosity            = LoggerVerbosity.Detailed;
            logger.Initialize(source, 4);
            RaiseEvents(source);
            Assert.IsTrue(logger.forwardedEvents.Count == 12);
            Assert.IsTrue(logger.forwardedEvents.Contains(error));
            Assert.IsTrue(logger.forwardedEvents.Contains(warning));
            Assert.IsTrue(logger.forwardedEvents.Contains(highMessage));
            Assert.IsTrue(logger.forwardedEvents.Contains(lowMessage));
            Assert.IsTrue(logger.forwardedEvents.Contains(normalMessage));
            Assert.IsTrue(logger.forwardedEvents.Contains(projectStarted));
            Assert.IsTrue(logger.forwardedEvents.Contains(projectFinished));
            Assert.IsTrue(logger.forwardedEvents.Contains(targetStarted));
            Assert.IsTrue(logger.forwardedEvents.Contains(targetFinished));
            Assert.IsTrue(logger.forwardedEvents.Contains(taskStarted));
            Assert.IsTrue(logger.forwardedEvents.Contains(taskFinished));
            Assert.IsTrue(logger.forwardedEvents.Contains(commandLine));

            logger = new TestForwardingLogger();
            logger.BuildEventRedirector = null;
            logger.Verbosity            = LoggerVerbosity.Diagnostic;
            logger.Initialize(source, 4);
            RaiseEvents(source);
            Assert.IsTrue(logger.forwardedEvents.Count == 13);
            Assert.IsTrue(logger.forwardedEvents.Contains(error));
            Assert.IsTrue(logger.forwardedEvents.Contains(warning));
            Assert.IsTrue(logger.forwardedEvents.Contains(highMessage));
            Assert.IsTrue(logger.forwardedEvents.Contains(lowMessage));
            Assert.IsTrue(logger.forwardedEvents.Contains(normalMessage));
            Assert.IsTrue(logger.forwardedEvents.Contains(projectStarted));
            Assert.IsTrue(logger.forwardedEvents.Contains(projectFinished));
            Assert.IsTrue(logger.forwardedEvents.Contains(targetStarted));
            Assert.IsTrue(logger.forwardedEvents.Contains(targetFinished));
            Assert.IsTrue(logger.forwardedEvents.Contains(taskStarted));
            Assert.IsTrue(logger.forwardedEvents.Contains(taskFinished));
            Assert.IsTrue(logger.forwardedEvents.Contains(externalStartedEvent));
            Assert.IsTrue(logger.forwardedEvents.Contains(commandLine));
        }
 public void ForwardingLoggingNoSummary()
 {
     EventSourceSink source = new EventSourceSink();
     TestForwardingLogger logger = new TestForwardingLogger();
     logger.BuildEventRedirector = null;
     logger.Verbosity = LoggerVerbosity.Normal;
     logger.Parameters = "NOSUMMARY";
     logger.Initialize(source, 4);
     RaiseEvents(source);
     Assert.Equal(11, logger.forwardedEvents.Count);
     Assert.True(logger.forwardedEvents.Contains(_buildStarted));
     Assert.True(logger.forwardedEvents.Contains(_buildFinished));
     Assert.True(logger.forwardedEvents.Contains(_error));
     Assert.True(logger.forwardedEvents.Contains(_warning));
     Assert.True(logger.forwardedEvents.Contains(_highMessage));
     Assert.True(logger.forwardedEvents.Contains(_normalMessage));
     Assert.True(logger.forwardedEvents.Contains(_projectStarted));
     Assert.True(logger.forwardedEvents.Contains(_projectFinished));
     Assert.True(logger.forwardedEvents.Contains(_targetStarted));
     Assert.True(logger.forwardedEvents.Contains(_targetFinished));
     Assert.True(logger.forwardedEvents.Contains(_commandLine));
 }
        public void ForwardingLoggingNoSummary()
        {

            EventSource source = new EventSource();
            TestForwardingLogger logger = new TestForwardingLogger();
            logger.BuildEventRedirector = null;
            logger.Verbosity = LoggerVerbosity.Normal;
             logger.Parameters = "NOSUMMARY";
            logger.Initialize(source, 4);
            RaiseEvents(source);
            Assert.IsTrue(logger.forwardedEvents.Count == 8);
            Assert.IsTrue(logger.forwardedEvents.Contains(error));
            Assert.IsTrue(logger.forwardedEvents.Contains(warning));
            Assert.IsTrue(logger.forwardedEvents.Contains(highMessage));
            Assert.IsTrue(logger.forwardedEvents.Contains(normalMessage));
            Assert.IsTrue(logger.forwardedEvents.Contains(projectStarted));
            Assert.IsTrue(logger.forwardedEvents.Contains(projectFinished));
            Assert.IsTrue(logger.forwardedEvents.Contains(targetStarted));
            Assert.IsTrue(logger.forwardedEvents.Contains(targetFinished));
        }