Пример #1
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();
        }
Пример #2
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();
 }
Пример #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();
        }
Пример #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();
        }
Пример #5
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();
        }
Пример #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();
        }
Пример #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();
        }
Пример #8
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();
        }