Пример #1
0
        public static void TestFilterEvent()
        {
            using (EventCountListener listener = new EventCountListener())
                using (TestSource log = new TestSource())
                {
                    listener.EnableEvents(log, EventLevel.Error);

                    /* This call should be filtered since it is at WarningLevel and we are logging Error */
                    log.WarningEventWithArgs(1, 2, 3, false);

                    /* This call should be filtered since it is at Verbose and we are logging Error */
                    log.VerboseEvent();

                    Assert.Equal(0, listener.EventCount);
                }
        }
Пример #2
0
        public static void TestFilterEvent()
        {
            using (EventCountListener listener = new EventCountListener())
            using (TestSource log = new TestSource())
            {
                listener.EnableEvents(log, EventLevel.Error);

                /* This call should be filtered since it is at WarningLevel and we are logging Error */
                log.WarningEventWithArgs(1, 2, 3, false);

                /* This call should be filtered since it is at Verbose and we are logging Error */
                log.VerboseEvent();

                Assert.Equal(0, listener.EventCount);
            }
        }