示例#1
0
            public void Should_define_the_identity_depends_on_CacheIdentity(bool accelerate)
            {
                // arrange
                const string expected = "TEST_IDENTITY";

                AccelerateForwardingAppender.CacheIdentity = accelerate;
                AccelerateForwardingAppender.Identity      = expected;

                var loggingEvent = new LoggingEvent(new LoggingEventData());

                // act
                AccelerateForwardingAppender.DoAppend(loggingEvent);
                var actual = loggingEvent.Identity;

                // assert
                var assert = accelerate ? (Action <string, string>)Assert.Equal : Assert.NotEqual;

                assert(expected, actual);
            }
示例#2
0
            public void Should_define_the_user_name_depends_on_CacheUsername(bool accelerate)
            {
                // arrange
                const string expected = "TEST_USER_NAME";

                AccelerateForwardingAppender.CacheUsername = accelerate;
                AccelerateForwardingAppender.Username      = expected;

                var loggingEvent = new LoggingEvent(new LoggingEventData());

                // act
                AccelerateForwardingAppender.DoAppend(loggingEvent);
                var actual = loggingEvent.UserName;

                // assert
                var assert = accelerate ? (Action <string, string>)Assert.Equal : Assert.NotEqual;

                assert(expected, actual);
            }
示例#3
0
 public TestBase()
 {
     AccelerateForwardingAppender = new AccelerateForwardingAppender();
 }