public void Test_Clone()
        {
            var test = new SqlConnectionInformation("blah", GoodConnection);
            var clone = test.Clone();

            Assert.Equal(test.ConnectionString, clone.ConnectionString);
            Assert.Equal(test.QueueName, clone.QueueName);
        }
 public void GetSet_Connection_Bad_Exception()
 {
     Assert.Throws<ArgumentException>(
     delegate
     {
         var test = new SqlConnectionInformation(string.Empty, BadConnection);
     });
 }
        public void Test_Clone()
        {
            var test  = new SqlConnectionInformation("blah", GoodConnection);
            var clone = test.Clone();

            Assert.Equal(test.ConnectionString, clone.ConnectionString);
            Assert.Equal(test.QueueName, clone.QueueName);
        }
示例#4
0
        public VerifyQueueRecordCount(string queueName, PostgreSqlMessageQueueTransportOptions options)
        {
            var queueConnection = new QueueConnection(queueName, ConnectionInfo.ConnectionString);

            _options         = options;
            _connection      = new SqlConnectionInformation(queueConnection);
            _tableNameHelper = new TableNameHelper(_connection);
        }
 public void GetSet_Connection_Bad_Exception()
 {
     Assert.Throws <ArgumentException>(
         delegate
     {
         // ReSharper disable once UnusedVariable
         var test = new SqlConnectionInformation(string.Empty, BadConnection);
     });
 }
示例#6
0
 public static void SetError(string queueName, string connectionString)
 {
     var connection = new SqlConnectionInformation(queueName, connectionString);
     var helper = new TableNameHelper(connection);
     using (var conn = new NpgsqlConnection(connectionString))
     {
         conn.Open();
         using (var command = conn.CreateCommand())
         {
             command.CommandText = $"update {helper.StatusName} set status = 2";
             command.ExecuteNonQuery();
         }
     }
 }
示例#7
0
        public static void SetError(string queueName, string connectionString, ICreationScope scope)
        {
            var connection = new SqlConnectionInformation(queueName, connectionString);
            var helper     = new TableNameHelper(connection);

            using (var conn = new SqlConnection(connectionString))
            {
                conn.Open();
                using (var command = conn.CreateCommand())
                {
                    command.CommandText = $"update {helper.StatusName} set status = 2";
                    command.ExecuteNonQuery();
                }
            }
        }
示例#8
0
 public static void Verify(string queueName, string connectionString, long messageCount)
 {
     var connection = new SqlConnectionInformation(queueName, connectionString);
     var helper = new TableNameHelper(connection);
     using (var conn = new NpgsqlConnection(connectionString))
     {
         conn.Open();
         using (var command = conn.CreateCommand())
         {
             command.CommandText = $"select count(*) from {helper.StatusName}";
             using (var reader = command.ExecuteReader())
             {
                 Assert.True(reader.Read());
                 var records = reader.GetInt32(0);
                 Assert.Equal(messageCount, records);
             }
         }
     }
 }
示例#9
0
        public static void Verify(string queueName, string connectionString, long messageCount, ICreationScope scope)
        {
            var connection = new SqlConnectionInformation(queueName, connectionString);
            var helper     = new TableNameHelper(connection);

            using (var conn = new SqlConnection(connectionString))
            {
                conn.Open();
                using (var command = conn.CreateCommand())
                {
                    command.CommandText = $"select count(*) from {helper.StatusName}";
                    using (var reader = command.ExecuteReader())
                    {
                        Assert.True(reader.Read());
                        var records = reader.GetInt32(0);
                        Assert.Equal(messageCount, records);
                    }
                }
            }
        }
示例#10
0
 public VerifyQueueData(string queueName, SqlServerMessageQueueTransportOptions options)
 {
     _options         = options;
     _connection      = new SqlConnectionInformation(queueName, ConnectionInfo.ConnectionString);
     _tableNameHelper = new TableNameHelper(_connection);
 }
示例#11
0
 public VerifyErrorCounts(string queueName)
 {
     _connection = new SqlConnectionInformation(queueName, ConnectionInfo.ConnectionString);
     _tableNameHelper = new TableNameHelper(_connection);
 }
        public void GetSet_Connection()
        {
            var test = new SqlConnectionInformation(string.Empty, GoodConnection);

            Assert.NotNull(test);
        }
示例#13
0
 public VerifyQueueData(string queueName, SqlServerMessageQueueTransportOptions options)
 {
     _options = options;
     _connection = new SqlConnectionInformation(queueName, ConnectionInfo.ConnectionString);
     _tableNameHelper = new TableNameHelper(_connection);
 }
示例#14
0
 public VerifyErrorCounts(string queueName)
 {
     _connection      = new SqlConnectionInformation(queueName, ConnectionInfo.ConnectionString);
     _tableNameHelper = new TableNameHelper(_connection);
 }
示例#15
0
 public VerifyQueueRecordCount(string queueName, PostgreSqlMessageQueueTransportOptions options)
 {
     _options = options;
     _connection = new SqlConnectionInformation(queueName, ConnectionInfo.ConnectionString);
     _tableNameHelper = new TableNameHelper(_connection);
 }
示例#16
0
 public VerifyErrorCounts(QueueConnection queueConnection)
 {
     _connection      = new SqlConnectionInformation(queueConnection);
     _tableNameHelper = new SqlServerTableNameHelper(_connection);
 }
示例#17
0
 public VerifyQueueRecordCount(QueueConnection queueConnection, SqlServerMessageQueueTransportOptions options)
 {
     _options         = options;
     _connection      = new SqlConnectionInformation(queueConnection);
     _tableNameHelper = new SqlServerTableNameHelper(_connection);
 }
 public void GetSet_Connection()
 {
     var test = new SqlConnectionInformation(string.Empty, GoodConnection);
     Assert.NotNull(test);
 }