Ejemplo n.º 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();
        }
Ejemplo n.º 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();
 }
Ejemplo n.º 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();
        }
Ejemplo n.º 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();
        }
Ejemplo n.º 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();
        }
Ejemplo n.º 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();
        }
Ejemplo n.º 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();
        }
Ejemplo n.º 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();
        }