Exemple #1
0
 public void PrepareNeedsCommands()
 {
     using var connection = new MySqlConnection(AppConfig.ConnectionString);
     connection.Open();
     using var batch = new MySqlBatch(connection);
     Assert.Throws <InvalidOperationException>(() => batch.Prepare());
 }
Exemple #2
0
 public void PrepareNeedsConnection()
 {
     using var batch = new MySqlBatch
           {
               BatchCommands =
               {
                   new MySqlBatchCommand("SELECT 1;"),
               },
           };
     Assert.Throws <InvalidOperationException>(() => batch.Prepare());
 }
Exemple #3
0
 public void PrepareNeedsOpenConnection()
 {
     using var connection = new MySqlConnection(AppConfig.ConnectionString);
     using var batch      = new MySqlBatch(connection)
           {
               BatchCommands =
               {
                   new MySqlBatchCommand("SELECT 1;"),
               },
           };
     Assert.Throws <InvalidOperationException>(() => batch.Prepare());
 }