Пример #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
            });
        }
        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
                };

            appender.ActivateOptions();

            return new UnitTestContext
                {
                    Repository = repository,
                    ErrorHandler = errorHandler,
                    Appender = appender
                };
        }
        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
            };

            appender.ActivateOptions();

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