From 972e90a55e8e7af3a649a01f572b45cb0bc3369c Mon Sep 17 00:00:00 2001 From: Dariusz Stempniak Date: Thu, 10 Oct 2024 01:02:12 +0200 Subject: [PATCH] SNOW-1729244 fix --- Snowflake.Data.Tests/UnitTests/SFDataConverterTest.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Snowflake.Data.Tests/UnitTests/SFDataConverterTest.cs b/Snowflake.Data.Tests/UnitTests/SFDataConverterTest.cs index fc2e8b274..181b0b87a 100755 --- a/Snowflake.Data.Tests/UnitTests/SFDataConverterTest.cs +++ b/Snowflake.Data.Tests/UnitTests/SFDataConverterTest.cs @@ -339,8 +339,12 @@ public void TestInvalidTimestampConversion(SFDataType dataType, Type unsupported object unsupportedObject; if (unsupportedType == typeof(DateTimeOffset)) unsupportedObject = new DateTimeOffset(); - else + else if (unsupportedType == typeof(DateTime)) unsupportedObject = new DateTime(); + else + unsupportedObject = null; + + Assert.NotNull(unsupportedType); SnowflakeDbException ex = Assert.Throws(() => SFDataConverter.csharpValToSfVal(dataType, unsupportedObject)); SnowflakeDbExceptionAssert.HasErrorCode(ex, SFError.INVALID_DATA_CONVERSION); }