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

            Assert.Equal(test.ConnectionString, clone.ConnectionString);
            Assert.Equal(test.QueueName, clone.QueueName);
        }
        public void Test_Clone()
        {
            var test  = new SqliteConnectionInformation("blah", GoodConnection, null);
            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 SqliteConnectionInformation(string.Empty, BadConnection);
     });
 }
 public static void SetError(QueueConnection queueConnection, ICreationScope scope)
 {
     var connection = new SqliteConnectionInformation(queueConnection, new DbDataSource());
     var helper = new TableNameHelper(connection);
     using (var conn = new SQLiteConnection(queueConnection.Connection))
     {
         conn.Open();
         using (var command = conn.CreateCommand())
         {
             command.CommandText = $"update {helper.StatusName} set status = 2";
             command.ExecuteNonQuery();
         }
     }
 }
Пример #5
0
 public static void SetError(string queueName, string connectionString)
 {
     var connection = new SqliteConnectionInformation(queueName, connectionString);
     var helper = new TableNameHelper(connection);
     using (var conn = new SQLiteConnection(connectionString))
     {
         conn.Open();
         using (var command = conn.CreateCommand())
         {
             command.CommandText = $"update {helper.StatusName} set status = 2";
             command.ExecuteNonQuery();
         }
     }
 }
 public static void Verify(QueueConnection queueConnection, long messageCount, ICreationScope scope)
 {
     var connection = new SqliteConnectionInformation(queueConnection, new DbDataSource());
     var helper = new TableNameHelper(connection);
     using (var conn = new SQLiteConnection(queueConnection.Connection))
     {
         conn.Open();
         using (var command = conn.CreateCommand())
         {
             command.CommandText = $"select count(*) from {helper.MetaDataName}";
             using (var reader = command.ExecuteReader())
             {
                 Assert.True(reader.Read());
                 var records = reader.GetInt32(0);
                 Assert.Equal(messageCount, records);
             }
         }
     }
 }
Пример #7
0
 public static void Verify(string queueName, string connectionString, long messageCount)
 {
     var connection = new SqliteConnectionInformation(queueName, connectionString);
     var helper = new TableNameHelper(connection);
     using (var conn = new SQLiteConnection(connectionString))
     {
         conn.Open();
         using (var command = conn.CreateCommand())
         {
             command.CommandText = $"select count(*) from {helper.MetaDataName}";
             using (var reader = command.ExecuteReader())
             {
                 Assert.True(reader.Read());
                 var records = reader.GetInt32(0);
                 Assert.Equal(messageCount, records);
             }
         }
     }
 }
 public void Get_Server()
 {
     var test = new SqliteConnectionInformation(string.Empty, GoodConnection);
     Assert.Equal(@"c:\temp\test.db", test.Server);
 }
 public void GetSet_Connection()
 {
     var test = new SqliteConnectionInformation(string.Empty, GoodConnection);
     Assert.NotNull(test);
 }
Пример #10
0
 public VerifyQueueData(string queueName, string connectionString, SqLiteMessageQueueTransportOptions options)
 {
     _options = options;
     _connection = new SqliteConnectionInformation(queueName, connectionString);
     _tableNameHelper = new TableNameHelper(_connection);
 }
Пример #11
0
 public VerifyErrorCounts(string queueName, string connectionString)
 {
     _connection = new SqliteConnectionInformation(queueName, connectionString);
     _tableNameHelper = new TableNameHelper(_connection);
 }
Пример #12
0
 public VerifyErrorCounts(string queueName, string connectionString)
 {
     _connection      = new SqliteConnectionInformation(queueName, connectionString, new DbDataSource());
     _tableNameHelper = new TableNameHelper(_connection);
 }
Пример #13
0
 public VerifyQueueData(string queueName, string connectionString, SqLiteMessageQueueTransportOptions options)
 {
     _options         = options;
     _connection      = new SqliteConnectionInformation(queueName, connectionString, new DbDataSource());
     _tableNameHelper = new TableNameHelper(_connection);
 }
        public void GetSet_Connection()
        {
            var test = new SqliteConnectionInformation(string.Empty, GoodConnection, null);

            Assert.NotNull(test);
        }