mr-smidge commented on a change in pull request #7654:
URL: https://github.com/apache/arrow/pull/7654#discussion_r463888181



##########
File path: csharp/test/Apache.Arrow.Tests/TestDateAndTimeData.cs
##########
@@ -0,0 +1,83 @@
+// 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.Linq;
+
+namespace Apache.Arrow.Tests
+{
+    /// <summary>
+    /// The <see cref="TestDateAndTimeData"/> class holds example dates and 
times useful for testing.
+    /// </summary>
+    internal static class TestDateAndTimeData
+    {
+        private static readonly DateTime _earliestDate = new DateTime(1, 1, 1);
+        private static readonly DateTime _latestDate = new DateTime(9999, 12, 
31);
+
+        private static readonly DateTime[] _exampleDates =
+        {
+            _earliestDate, new DateTime(1969, 12, 31), new DateTime(1970, 1, 
1), new DateTime(1970, 1, 2),
+            new DateTime(1972, 6, 30), new DateTime(2015, 6, 30), new 
DateTime(2016, 12, 31), new DateTime(2020, 2, 29),
+            new DateTime(2020, 7, 1), _latestDate,
+        };
+
+        private static readonly TimeSpan[] _exampleTimes =
+        {
+            new TimeSpan(0, 0, 1), new TimeSpan(12, 0, 0), new TimeSpan(23, 
59, 59),
+        };
+
+        private static readonly DateTimeKind[] _exampleKinds =
+        {
+            DateTimeKind.Local, DateTimeKind.Unspecified, DateTimeKind.Utc,
+        };
+
+        private static readonly TimeSpan[] _exampleOffsets =
+        {
+            TimeSpan.FromHours(-2),
+            TimeSpan.Zero,
+            TimeSpan.FromHours(2),
+        };
+
+        /// <summary>
+        /// Gets a collection of example dates (i.e. with a zero time 
component), of all different kinds.
+        /// </summary>
+        public static IEnumerable<DateTime> ExampleDates =>

Review comment:
       These properties provide a useful set of test data that acts over the 
cartesian product of dates/times/kinds/offsets, so that testing all possible 
combinations is straightforward.




----------------------------------------------------------------
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.

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


Reply via email to