public void listen_by_exact_type()
        {
            var listener = new DebugListener(Level.InfoOnly);
            listener.ListenFor<Log1>();

            listener.ListensFor(typeof(Log1)).ShouldBeTrue();
            listener.ListensFor(typeof(Log2)).ShouldBeFalse();
        }
 public void listens_for_type_with_no_filters()
 {
     var listener = new DebugListener(Level.InfoOnly);
     listener.ListensFor(GetType()).ShouldBeTrue();
     listener.ListensFor(typeof(Log1)).ShouldBeTrue();
     listener.ListensFor(typeof(Log2)).ShouldBeTrue();
     listener.ListensFor(typeof(Log3)).ShouldBeTrue();
 }
Example #3
0
        public void listen_by_exact_type()
        {
            var listener = new DebugListener(Level.InfoOnly);

            listener.ListenFor <Log1>();

            listener.ListensFor(typeof(Log1)).ShouldBeTrue();
            listener.ListensFor(typeof(Log2)).ShouldBeFalse();
        }
Example #4
0
        public void listens_for_type_with_no_filters()
        {
            var listener = new DebugListener(Level.InfoOnly);

            listener.ListensFor(GetType()).ShouldBeTrue();
            listener.ListensFor(typeof(Log1)).ShouldBeTrue();
            listener.ListensFor(typeof(Log2)).ShouldBeTrue();
            listener.ListensFor(typeof(Log3)).ShouldBeTrue();
        }
        public void listens_for_with_multiple_matches()
        {
            var listener = new DebugListener(Level.InfoOnly);
            listener.ListenFor<Log1>().ListenFor<Log2>();

            listener.ListensFor(typeof(Log1)).ShouldBeTrue();
            listener.ListensFor(typeof(Log2)).ShouldBeTrue();
            listener.ListensFor(typeof(Log3)).ShouldBeFalse();
        }
Example #6
0
        public void listens_for_with_multiple_matches()
        {
            var listener = new DebugListener(Level.InfoOnly);

            listener.ListenFor <Log1>().ListenFor <Log2>();

            listener.ListensFor(typeof(Log1)).ShouldBeTrue();
            listener.ListensFor(typeof(Log2)).ShouldBeTrue();
            listener.ListensFor(typeof(Log3)).ShouldBeFalse();
        }
Example #7
0
        public void listen_for_implementing()
        {
            var listener = new DebugListener(Level.All)
                           .ListenForAnythingImplementing <LogRecord>();

            listener.ListensFor(GetType()).ShouldBeFalse();

            listener.ListensFor(typeof(Log1)).ShouldBeTrue();
            listener.ListensFor(typeof(Log2)).ShouldBeTrue();
            listener.ListensFor(typeof(Log3)).ShouldBeTrue();
        }
        public void listen_for_implementing()
        {
            var listener = new DebugListener(Level.All)
                .ListenForAnythingImplementing<LogRecord>();

            listener.ListensFor(GetType()).ShouldBeFalse();

            listener.ListensFor(typeof(Log1)).ShouldBeTrue();
            listener.ListensFor(typeof(Log2)).ShouldBeTrue();
            listener.ListensFor(typeof(Log3)).ShouldBeTrue();
        }