davidhcoe commented on code in PR #697:
URL: https://github.com/apache/arrow-adbc/pull/697#discussion_r1211006411


##########
csharp/test/Apache.Arrow.Adbc.FlightSql.Tests/DriverConnectionTests.cs:
##########
@@ -0,0 +1,81 @@
+using System.Collections.Generic;
+using System.IO;
+using Apache.Arrow.Adbc.Core;
+using Apache.Arrow.Adbc.FlightSql;
+using Apache.Arrow.Adbc.FlightSql.Tests;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+using Newtonsoft.Json;
+
+namespace Apache.Arrow.Adbc.Tests
+{
+    [TestClass]
+    public class FlightSqlDriverConnectionTests : DriverConnectionTests
+    {
+        [TestMethod]
+        public override void CanDriverConnect()
+        {
+            FlightSqlTestConfiguration flightSqlTestConfiguration = 
GetFlightSqlTestConfiguration();
+
+            Dictionary<string, string> parameters = new Dictionary<string, 
string>
+            {
+                { FlightSqlParameters.ServerAddress, 
flightSqlTestConfiguration.ServerAddress },
+                { FlightSqlParameters.RoutingTag, 
flightSqlTestConfiguration.RoutingTag },
+                { FlightSqlParameters.RoutingQueue, 
flightSqlTestConfiguration.RoutingQueue },
+                { FlightSqlParameters.Authorization, 
flightSqlTestConfiguration.Authorization}
+            };
+
+            Dictionary<string, string> options = new Dictionary<string, 
string>()
+            {
+                { FlightSqlParameters.ServerAddress, 
flightSqlTestConfiguration.ServerAddress },
+            };
+
+            FlightSqlDriver flightSqlDriver = new FlightSqlDriver();
+            FlightSqlDatabase flightSqlDatabase = 
flightSqlDriver.Open(parameters) as FlightSqlDatabase;
+            FlightSqlConnection connection = 
flightSqlDatabase.Connect(options) as FlightSqlConnection;
+            FlightSqlStatement statement = connection.CreateStatement() as 
FlightSqlStatement;
+
+            statement.SqlQuery = flightSqlTestConfiguration.Query;
+            QueryResult queryResult = statement.ExecuteQuery();
+
+            long count = 0;
+
+            while (true)
+            {
+                var nextBatch = 
queryResult.Stream.ReadNextRecordBatchAsync().Result;
+                if (nextBatch == null) { break; }
+                count += nextBatch.Length;
+            }
+
+            Assert.AreEqual(flightSqlTestConfiguration.ExpectedResultsCount, 
count);
+        }
+    
+        public override void CanDriverUpdate()
+        {
+            throw new System.NotImplementedException();
+        }
+
+        public override void CanReadSchema()
+        {
+            throw new System.NotImplementedException();
+        }
+
+        public override void VerifyBadQueryGeneratesError()
+        {
+            throw new System.NotImplementedException();
+        }
+
+        public override void VerifyTypesAndValues()
+        {
+            throw new System.NotImplementedException();
+        }
+
+        private FlightSqlTestConfiguration GetFlightSqlTestConfiguration()
+        {
+            string json = File.ReadAllText("flightsqlconfig.pass");

Review Comment:
   added a bit more of an explanation. it's setup this way in lieu of doing 
environment variables. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to