Example #1
0
        public void should_publish_results_to_all_listeners()
        {
            var firstListener = Mock <IDiagnosticListener> .Create();

            var secondListener = Mock <IDiagnosticListener> .Create();

            var results = new DiagnosticResults(new ScannedSource[0], new Type[0], new Type[0], new SkippedAutomappingType[0], new Type[0], new AutomappingType[0]);

            despatcher.RegisterListener(firstListener);
            despatcher.RegisterListener(secondListener);
            despatcher.Publish(results);

            firstListener.AssertWasCalled(x => x.Receive(results));
            secondListener.AssertWasCalled(x => x.Receive(results));
        }
 /// <summary>
 /// Register a logging listener
 /// </summary>
 /// <param name="listener">Listener</param>
 public DiagnosticsConfiguration RegisterListener(IDiagnosticListener listener)
 {
     despatcher.RegisterListener(listener);
     return(this);
 }