Exemple #1
0
        public static UnitTestContext Create(int bufferSize = BufferSize, bool?failSend = null, bool?failClose = null)
        {
            var repository   = new RepositoryStub();
            var errorHandler = new ErrorHandlerStub();

            var appender = new TestableAppender(repository)
            {
                Lossy                      = false,
                BufferSize                 = bufferSize,
                ConnectionString           = ConnectionString,
                ErrorHandler               = errorHandler,
                FailSend                   = failSend,
                FailClose                  = failClose,
                RollingIndexNameDateFormat = "yyyy-MM-dd"
            };

            appender.AddFieldNameOverride(new FieldNameOverride
            {
                Original    = "timetamp",
                Replacement = "timestamp"
            }
                                          );

            appender.AddFieldValueReplica(new FieldValueReplica
            {
                Original = "timeStamp",
                Replica  = "@timestamp"
            }
                                          );

            appender.ActivateOptions();

            return(new UnitTestContext
            {
                Repository = repository,
                ErrorHandler = errorHandler,
                Appender = appender
            });
        }
Exemple #2
0
        public static UnitTestContext Create(int bufferSize = BufferSize, bool?failSend = null, bool?failClose = null)
        {
            var repository   = new RepositoryStub();
            var errorHandler = new ErrorHandlerStub();

            var appender = new TestableAppender(repository)
            {
                ConnectionString = ConnectionString,
                ErrorHandler     = errorHandler,
                FailSend         = failSend,
                FailClose        = failClose,
                MaxRetries       = 0
            };

            appender.ActivateOptions();

            return(new UnitTestContext
            {
                Repository = repository,
                ErrorHandler = errorHandler,
                Appender = appender
            });
        }
Exemple #3
0
        public static UnitTestContext Create(int bufferSize = BufferSize, bool?failSend = null, bool?failClose = null)
        {
            var repository   = new RepositoryStub();
            var errorHandler = new ErrorHandlerStub();

            var appender = new TestableAppender(repository)
            {
                Lossy        = false,
                BufferSize   = bufferSize,
                ServerList   = ServerList,
                ErrorHandler = errorHandler,
                FailSend     = failSend,
                FailClose    = failClose
            };

            appender.ActivateOptions();

            return(new UnitTestContext
            {
                Repository = repository,
                ErrorHandler = errorHandler,
                Appender = appender
            });
        }