diff --git a/Snowflake.Data.Tests/IntegrationTests/SFDbDataReaderIT.cs b/Snowflake.Data.Tests/IntegrationTests/SFDbDataReaderIT.cs index e0b51a8be..a1b89dc1a 100755 --- a/Snowflake.Data.Tests/IntegrationTests/SFDbDataReaderIT.cs +++ b/Snowflake.Data.Tests/IntegrationTests/SFDbDataReaderIT.cs @@ -15,8 +15,7 @@ namespace Snowflake.Data.Tests.IntegrationTests { - // TODO: enable tests for Arrow - //[TestFixture(ResultFormat.ARROW)] + [TestFixture(ResultFormat.ARROW)] [TestFixture(ResultFormat.JSON)] class SFDbDataReaderIT : SFBaseTest { @@ -186,7 +185,7 @@ public void TestGetDate(string inputTimeStr) [Test] public void TestDateOutputFormat() { - using (IDbConnection conn = new SnowflakeDbConnection()) + using (IDbConnection conn = CreateAndOpenConnection()) { conn.ConnectionString = ConnectionString; conn.Open(); @@ -200,6 +199,7 @@ public void TestDateOutputFormat() cmd.CommandText = $"select TO_DATE('2013-05-17')"; IDataReader reader = cmd.ExecuteReader(); + ValidateResultFormat(reader); Assert.IsTrue(reader.Read()); Assert.AreEqual("05/17/2013", reader.GetString(0)); @@ -607,7 +607,7 @@ public void TestGetBoolean() [Test] public void TestGetByte() { - using (IDbConnection conn = new SnowflakeDbConnection()) + using (IDbConnection conn = CreateAndOpenConnection()) { // Arrange conn.ConnectionString = ConnectionString; @@ -639,6 +639,7 @@ public void TestGetByte() while (reader.Read()) { // Assert + ValidateResultFormat(reader); Assert.AreEqual(testBytes[index++], reader.GetByte(0)); } } @@ -790,7 +791,7 @@ public void TestGetBinary() [Test] public void TestGetChar() { - using (IDbConnection conn = new SnowflakeDbConnection()) + using (IDbConnection conn = CreateAndOpenConnection()) { // Arrange conn.ConnectionString = ConnectionString; @@ -812,6 +813,7 @@ public void TestGetChar() using (IDataReader reader = cmd.ExecuteReader()) { // Assert + ValidateResultFormat(reader); Assert.IsTrue(reader.Read()); Assert.AreEqual(testChar, reader.GetChar(0)); } @@ -965,7 +967,7 @@ public void TestGetChars() [Test] public void TestGetDataTypeName() { - using (IDbConnection conn = new SnowflakeDbConnection()) + using (IDbConnection conn = CreateAndOpenConnection()) { // Arrange conn.ConnectionString = ConnectionString; @@ -998,6 +1000,7 @@ public void TestGetDataTypeName() using (DbDataReader reader = (DbDataReader)cmd.ExecuteReader()) { // Assert + ValidateResultFormat(reader); Assert.IsTrue(reader.Read()); Assert.AreEqual("TEXT", reader.GetDataTypeName(0)); Assert.AreEqual("BINARY", reader.GetDataTypeName(1)); diff --git a/Snowflake.Data.Tests/UnitTests/Logger/EasyLoggerManagerTest.cs b/Snowflake.Data.Tests/UnitTests/Logger/EasyLoggerManagerTest.cs index feeb728b9..a648e914f 100644 --- a/Snowflake.Data.Tests/UnitTests/Logger/EasyLoggerManagerTest.cs +++ b/Snowflake.Data.Tests/UnitTests/Logger/EasyLoggerManagerTest.cs @@ -22,9 +22,7 @@ public class EasyLoggerManagerTest private const string ErrorMessage = "Easy logging Error message"; private const string FatalMessage = "Easy logging Fatal message"; private static readonly string s_logsDirectory = Path.GetTempPath(); - - [ThreadStatic] - private static string t_directoryLogPath; + private string _directoryLogPath; [OneTimeTearDown] public static void CleanUp() @@ -35,13 +33,13 @@ public static void CleanUp() [SetUp] public void BeforeEach() { - t_directoryLogPath = RandomLogsDirectoryPath(); + _directoryLogPath = RandomLogsDirectoryPath(); } [TearDown] public void AfterEach() { - EasyLoggerManager.Instance.ReconfigureEasyLogging(EasyLoggingLogLevel.Warn, t_directoryLogPath); + EasyLoggerManager.Instance.ReconfigureEasyLogging(EasyLoggingLogLevel.Warn, _directoryLogPath); } [Test] @@ -49,7 +47,7 @@ public void TestThatChangesLogLevel() { // arrange var logger = SFLoggerFactory.GetLogger(); - EasyLoggerManager.Instance.ReconfigureEasyLogging(EasyLoggingLogLevel.Warn, t_directoryLogPath); + EasyLoggerManager.Instance.ReconfigureEasyLogging(EasyLoggingLogLevel.Warn, _directoryLogPath); // assert Assert.IsFalse(logger.IsDebugEnabled()); @@ -59,7 +57,7 @@ public void TestThatChangesLogLevel() Assert.IsTrue(logger.IsFatalEnabled()); // act - EasyLoggerManager.Instance.ReconfigureEasyLogging(EasyLoggingLogLevel.Debug, t_directoryLogPath); + EasyLoggerManager.Instance.ReconfigureEasyLogging(EasyLoggingLogLevel.Debug, _directoryLogPath); // assert Assert.IsTrue(logger.IsDebugEnabled()); @@ -74,7 +72,7 @@ public void TestThatLogsToProperFileWithProperLogLevelOnly() { // arrange var logger = SFLoggerFactory.GetLogger(); - EasyLoggerManager.Instance.ReconfigureEasyLogging(EasyLoggingLogLevel.Info, t_directoryLogPath); + EasyLoggerManager.Instance.ReconfigureEasyLogging(EasyLoggingLogLevel.Info, _directoryLogPath); // act logger.Debug(DebugMessage); @@ -84,7 +82,7 @@ public void TestThatLogsToProperFileWithProperLogLevelOnly() logger.Fatal(FatalMessage); // assert - var logLines = File.ReadLines(FindLogFilePath(t_directoryLogPath)); + var logLines = File.ReadLines(FindLogFilePath(_directoryLogPath)); Assert.That(logLines, Has.Exactly(0).Matches(s => s.Contains(DebugMessage))); Assert.That(logLines, Has.Exactly(1).Matches(s => s.Contains(InfoMessage))); Assert.That(logLines, Has.Exactly(1).Matches(s => s.Contains(WarnMessage)));