|
4 | 4 | using System.Linq;
|
5 | 5 | using System.Net;
|
6 | 6 | using System.Numerics;
|
| 7 | +using System.Threading.Tasks; |
7 | 8 | using ClickHouse.Client.ADO;
|
8 | 9 | using ClickHouse.Client.Numerics;
|
9 | 10 | using ClickHouse.Client.Utility;
|
@@ -31,6 +32,14 @@ static TestUtilities()
|
31 | 32 | }
|
32 | 33 | }
|
33 | 34 |
|
| 35 | + [Test] |
| 36 | + public static async Task ExpectedFeaturesShouldMatchActualFeatures() |
| 37 | + { |
| 38 | + using var connection = GetTestClickHouseConnection(); |
| 39 | + await connection.OpenAsync(); |
| 40 | + Assert.AreEqual(SupportedFeatures & connection.SupportedFeatures, connection.SupportedFeatures); |
| 41 | + } |
| 42 | + |
34 | 43 | /// <summary>
|
35 | 44 | /// Utility method to allow to redirect ClickHouse connections to different machine, in case of Windows development environment
|
36 | 45 | /// </summary>
|
@@ -134,12 +143,9 @@ public static IEnumerable<DataTypeSample> GetDataTypeSamples()
|
134 | 143 | yield return new DataTypeSample("DateTime('UTC')", typeof(DateTime), "toDateTime('1988-08-28 11:22:33', 'UTC')", new DateTime(1988, 08, 28, 11, 22, 33, DateTimeKind.Unspecified));
|
135 | 144 | yield return new DataTypeSample("DateTime('Pacific/Fiji')", typeof(DateTime), "toDateTime('1999-01-01 13:00:00', 'Pacific/Fiji')", new DateTime(1999, 01, 01, 13, 00, 00, DateTimeKind.Unspecified));
|
136 | 145 |
|
137 |
| - if (SupportedFeatures.HasFlag(Feature.DateTime64)) |
138 |
| - { |
139 |
| - yield return new DataTypeSample("DateTime64(4, 'UTC')", typeof(DateTime), "toDateTime64('2043-03-01 18:34:04.4444', 9, 'UTC')", new DateTime(644444444444444000, DateTimeKind.Utc)); |
140 |
| - yield return new DataTypeSample("DateTime64(7, 'UTC')", typeof(DateTime), "toDateTime64('2043-03-01 18:34:04.4444444', 9, 'UTC')", new DateTime(644444444444444444, DateTimeKind.Utc)); |
141 |
| - yield return new DataTypeSample("DateTime64(7, 'Pacific/Fiji')", typeof(DateTime), "toDateTime64('2043-03-01 18:34:04.4444444', 9, 'Pacific/Fiji')", new DateTime(644444444444444444, DateTimeKind.Unspecified)); |
142 |
| - } |
| 146 | + yield return new DataTypeSample("DateTime64(4, 'UTC')", typeof(DateTime), "toDateTime64('2043-03-01 18:34:04.4444', 9, 'UTC')", new DateTime(644444444444444000, DateTimeKind.Utc)); |
| 147 | + yield return new DataTypeSample("DateTime64(7, 'UTC')", typeof(DateTime), "toDateTime64('2043-03-01 18:34:04.4444444', 9, 'UTC')", new DateTime(644444444444444444, DateTimeKind.Utc)); |
| 148 | + yield return new DataTypeSample("DateTime64(7, 'Pacific/Fiji')", typeof(DateTime), "toDateTime64('2043-03-01 18:34:04.4444444', 9, 'Pacific/Fiji')", new DateTime(644444444444444444, DateTimeKind.Unspecified)); |
143 | 149 |
|
144 | 150 | if (SupportedFeatures.HasFlag(Feature.Decimals))
|
145 | 151 | {
|
|
0 commit comments