Inheritance: ITraceManager
        public void NoHostListenerOnlyHasDefaultListenerOnSource()
        {
            var traceManager = new TraceManager();
            TraceSource source = traceManager["Random"];

            Assert.Equal(1, source.Listeners.Count);
        }
        public void PassingHostListenerSetsListenerOnSources()
        {
            var hostListener = new TextWriterTraceListener(new StringWriter());
            var traceManager = new TraceManager(hostListener);
            TraceSource source = traceManager["Random"];

            Assert.Equal(1, source.Listeners.Count);
            Assert.Same(hostListener, source.Listeners[0]);
        }
 private DefaultDependencyResolver GetDependencyResolver()
 {
     var dr = new DefaultDependencyResolver();
     var traceManager = new TraceManager();
     dr.Register(typeof(ITraceManager), () => traceManager);
     return dr;
 }