public void DisposeCreateDbCommandTest()
        {
            BigQueryConnection connection = new BigQueryConnection(ConnectionStringHelper.OAuthConnectionString);

            connection.Dispose();
            Assert.Throws <ObjectDisposedException>(() => { connection.CreateCommand(); });
        }
 public void CreateDbCommandTest()
 {
     using (BigQueryConnection connection = new BigQueryConnection(ConnectionStringHelper.OAuthConnectionString)) {
         connection.Open();
         var dbCommand = connection.CreateCommand();
         Assert.NotNull(dbCommand);
         Assert.NotNull(dbCommand.Connection);
         Assert.Same(connection, dbCommand.Connection);
         Assert.Equal("", dbCommand.CommandText);
         Assert.Null(dbCommand.Transaction);
         Assert.NotNull(dbCommand.Parameters);
         Assert.Empty(dbCommand.Parameters);
         Assert.Equal((CommandType)0, dbCommand.CommandType);
     }
 }
 public void DisposeCreateDbCommandTest() {
     BigQueryConnection connection = new BigQueryConnection(ConnectionStringHelper.OAuthConnectionString);
     connection.Dispose();
     Assert.Throws<ObjectDisposedException>(() => { connection.CreateCommand(); });
 }
 public void ExecuteReaderTest_TypeText()
 {
     using (var dbCommand = connection.CreateCommand()) {
         dbCommand.CommandText = commandText;
         dbCommand.CommandType = CommandType.Text;
         var dbDataReader = dbCommand.ExecuteReader();
         Assert.NotNull(dbDataReader);
         Assert.Equal(2, dbDataReader.FieldCount);
     }
 }
 public void CreateDbCommandTest() {
     using(BigQueryConnection connection = new BigQueryConnection(ConnectionStringHelper.OAuthConnectionString)) {
         connection.Open();
         var dbCommand = connection.CreateCommand();
         Assert.NotNull(dbCommand);
         Assert.NotNull(dbCommand.Connection);
         Assert.Same(connection, dbCommand.Connection);
         Assert.Equal("", dbCommand.CommandText);
         Assert.Null(dbCommand.Transaction);
         Assert.NotNull(dbCommand.Parameters);
         Assert.Equal(0, dbCommand.Parameters.Count);
         Assert.Equal((CommandType)0, dbCommand.CommandType);
     }
 }