public void GetSet_EnableStatus() { var test = new PostgreSqlMessageQueueTransportOptions(); var c = test.EnableStatus; test.EnableStatus = !c; Assert.Equal(!c, test.EnableStatus); }
public void GetSet_EnableHeartBeat() { var test = new PostgreSqlMessageQueueTransportOptions(); var c = test.EnableHeartBeat; test.EnableHeartBeat = !c; Assert.Equal(!c, test.EnableHeartBeat); }
public void GetSet_Priority() { var test = new PostgreSqlMessageQueueTransportOptions(); var c = test.EnablePriority; test.EnablePriority = !c; Assert.Equal(!c, test.EnablePriority); }
public void GetSet_EnableHoldTransactionUntilMessageCommited() { var test = new PostgreSqlMessageQueueTransportOptions(); var c = test.EnableHoldTransactionUntilMessageCommited; test.EnableHoldTransactionUntilMessageCommited = !c; Assert.Equal(!c, test.EnableHoldTransactionUntilMessageCommited); }
public void GetSet_EnableDelayedProcessing() { var test = new PostgreSqlMessageQueueTransportOptions(); var c = test.EnableDelayedProcessing; test.EnableDelayedProcessing = !c; Assert.Equal(!c, test.EnableDelayedProcessing); }
public void Create_Status() { var tableName = GetTableNameHelper(); var options = new PostgreSqlMessageQueueTransportOptions {EnableStatusTable = true}; var factory = Substitute.For<IPostgreSqlMessageQueueTransportOptionsFactory>(); factory.Create().Returns(options); var test = Create(factory, tableName); var tables = test.GetSchema(); Assert.True(tables.Any(item => item.Name == tableName.StatusName)); }
/// <summary> /// Initializes a new instance of the <see cref="Connection" /> class. /// </summary> /// <param name="connectionInfo">The connection information.</param> /// <param name="options">The options.</param> public Connection(IConnectionInformation connectionInfo, PostgreSqlMessageQueueTransportOptions options) { NpgsqlConnection = new NpgsqlConnection(connectionInfo.ConnectionString); NpgsqlConnection.Open(); if (options.EnableHoldTransactionUntilMessageCommited) { NpgsqlTransaction = NpgsqlConnection.BeginTransaction(IsolationLevel.ReadCommitted); } }
public void Create_Meta_Priority() { var tableName = GetTableNameHelper(); var options = new PostgreSqlMessageQueueTransportOptions {EnablePriority = true}; var factory = Substitute.For<IPostgreSqlMessageQueueTransportOptionsFactory>(); factory.Create().Returns(options); var test = Create(factory, tableName); var tables = test.GetSchema(); var statusTable = tables.Find(item => item.Name == tableName.MetaDataName); Assert.True(statusTable.Columns.Items.Any(item => item.Name == "Priority")); }
public void Create_Status_Extra_Columns() { var tableName = GetTableNameHelper(); var options = new PostgreSqlMessageQueueTransportOptions {EnableStatusTable = true}; options.AdditionalColumns.Add(new Column("testing", ColumnTypes.Bigint, true)); var factory = Substitute.For<IPostgreSqlMessageQueueTransportOptionsFactory>(); factory.Create().Returns(options); var test = Create(factory, tableName); var tables = test.GetSchema(); var statusTable = tables.Find(item => item.Name == tableName.StatusName); Assert.True(statusTable.Columns.Items.Any(item => item.Name == "testing")); }
public void Test_DefaultNotReadOnly() { var test = new PostgreSqlMessageQueueTransportOptions(); Assert.False(test.IsReadOnly); }
public void Readonly() { var test = new PostgreSqlMessageQueueTransportOptions(); test.SetReadOnly(); Assert.True(test.IsReadOnly); }
public void GetSet_EnableMessageExpiration() { var test = new PostgreSqlMessageQueueTransportOptions(); var c = test.EnableMessageExpiration; test.EnableMessageExpiration = !c; Assert.Equal(!c, test.EnableMessageExpiration); }
private PostgreSqlMessageQueueSchema Create() { var options = new PostgreSqlMessageQueueTransportOptions(); var factory = Substitute.For<IPostgreSqlMessageQueueTransportOptionsFactory>(); factory.Create().Returns(options); return Create(factory); }
public void Create_FIFO() { var tableName = GetTableNameHelper(); var options = new PostgreSqlMessageQueueTransportOptions { EnableStatus = false, EnableHeartBeat = false, EnablePriority = false }; var factory = Substitute.For<IPostgreSqlMessageQueueTransportOptionsFactory>(); factory.Create().Returns(options); var test = Create(factory, tableName); var tables = test.GetSchema(); Assert.NotNull(tables); }
public void Validation() { var test = new PostgreSqlMessageQueueTransportOptions(); test.ValidConfiguration(); }
public void GetSet_QueueType() { var test = new PostgreSqlMessageQueueTransportOptions {QueueType = QueueTypes.RpcReceive}; Assert.Equal(QueueTypes.RpcReceive, test.QueueType); }
public VerifyQueueData(string queueName, PostgreSqlMessageQueueTransportOptions options) { _options = options; _connection = new SqlConnectionInformation(queueName, ConnectionInfo.ConnectionString); _tableNameHelper = new TableNameHelper(_connection); }