jduo commented on code in PR #1849:
URL: https://github.com/apache/arrow-adbc/pull/1849#discussion_r1602071053


##########
csharp/test/Drivers/Apache/Spark/StatementTests.cs:
##########
@@ -0,0 +1,106 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements.  See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License, Version 2.0
+* (the "License"); you may not use this file except in compliance with
+* the License.  You may obtain a copy of the License at
+*
+*    http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+using System;
+using System.Collections.Generic;
+using System.Threading.Tasks;
+using Apache.Arrow.Adbc.Drivers.Apache.Spark;
+using Apache.Arrow.Adbc.Tests.Xunit;
+using Xunit;
+using Xunit.Abstractions;
+
+namespace Apache.Arrow.Adbc.Tests.Drivers.Apache.Spark
+{
+    /// <summary>
+    /// Class for testing the Snowflake ADBC driver connection tests.
+    /// </summary>
+    /// <remarks>
+    /// Tests are ordered to ensure data is created for the other
+    /// queries to run.
+    /// </remarks>
+    [TestCaseOrderer("Apache.Arrow.Adbc.Tests.Xunit.TestOrderer", 
"Apache.Arrow.Adbc.Tests")]
+    public class StatementTests : SparkTestBase
+    {
+        private static List<string> DefaultTableTypes => new() { "BASE TABLE", 
"VIEW" };
+
+        public StatementTests(ITestOutputHelper? outputHelper) : 
base(outputHelper)
+        {
+            Skip.IfNot(Utils.CanExecuteTestConfig(TestConfigVariable));
+        }
+
+        /// <summary>
+        /// Validates if the SetOption handle valid/invalid data correctly for 
the PollTime option.
+        /// </summary>
+        [SkippableTheory]
+        [InlineData("-1", true)]
+        [InlineData("zero", true)]
+        [InlineData("-2147483648", true)]
+        [InlineData("2147483648", true)]
+        [InlineData("0")]
+        [InlineData("1")]
+        [InlineData("2147483647")]
+        public void CanSetOptionPollTime(string value, bool throws = false)
+        {
+            AdbcStatement statement = NewConnection().CreateStatement();
+            if (throws)
+            {
+                Assert.Throws<ArgumentException>(() => 
statement.SetOption(SparkStatement.Options.PollTimeMilliseconds, value));
+            }
+            else
+            {
+                
statement.SetOption(SparkStatement.Options.PollTimeMilliseconds, value);
+            }
+        }
+
+        /// <summary>
+        /// Validates if the SetOption handle valid/invalid data correctly for 
the BatchSize option.
+        /// </summary>
+        [SkippableTheory]
+        [InlineData("-1", true)]
+        [InlineData("one", true)]
+        [InlineData("-2147483648", true)]
+        [InlineData("2147483648", true)]
+        [InlineData("0", true)]
+        [InlineData("1")]
+        [InlineData("2147483647")]
+        public void CanSetOptionBatchSize(string value, bool throws = false)
+        {
+            AdbcStatement statement = NewConnection().CreateStatement();
+            if (throws)
+            {
+                Assert.Throws<ArgumentException>(() => 
statement.SetOption(SparkStatement.Options.BatchSize, value));
+            }
+            else
+            {
+                statement.SetOption(SparkStatement.Options.BatchSize, value);

Review Comment:
   Should these tests roundtrip and verify the option is set correctly?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to