/// <summary> /// Construct a sink posting to the specified database. /// </summary> /// <param name="connectionString">Connection string to access the database.</param> /// <param name="sinkOptions">Supplies additional options for the sink</param> /// <param name="formatProvider">Supplies culture-specific formatting information, or null.</param> /// <param name="columnOptions">Options that pertain to columns</param> /// <param name="logEventFormatter">Supplies custom formatter for the LogEvent column, or null</param> public MSSqlServerSink( string connectionString, SinkOptions sinkOptions, IFormatProvider formatProvider = null, ColumnOptions columnOptions = null, ITextFormatter logEventFormatter = null) : this(sinkOptions, SinkDependenciesFactory.Create(connectionString, sinkOptions, formatProvider, columnOptions, logEventFormatter)) { }
public void CreatesSinkDependenciesWithSqlLogEventWriter() { // Act var result = SinkDependenciesFactory.Create(_connectionString, _sinkOptions, null, _columnOptions, null); // Assert Assert.NotNull(result.SqlLogEventWriter); Assert.IsType <SqlLogEventWriter>(result.SqlLogEventWriter); }
public void CreatesSinkDependenciesWithDataTableCreator() { // Act var result = SinkDependenciesFactory.Create(_connectionString, _sinkOptions, null, _columnOptions, null); // Assert Assert.NotNull(result.DataTableCreator); Assert.IsType <DataTableCreator>(result.DataTableCreator); }
public void DefaultsColumnOptionsIfNull() { // Act (should not throw) SinkDependenciesFactory.Create(_connectionString, _sinkOptions, null, null, null); }