diff --git a/Snowflake.Data.Tests/UnitTests/Tools/DirectoryInformationTest.cs b/Snowflake.Data.Tests/UnitTests/Tools/DirectoryInformationTest.cs index b8baa2e68..8167e484a 100644 --- a/Snowflake.Data.Tests/UnitTests/Tools/DirectoryInformationTest.cs +++ b/Snowflake.Data.Tests/UnitTests/Tools/DirectoryInformationTest.cs @@ -36,13 +36,6 @@ public void TestIsNotCreatedEarlierThanSeconds(bool dirExists, DateTime? created Assert.AreEqual(false, result); } - [Test] - public void TestCompareDates() // for debugging - { - var condition = DateTime.UtcNow.AddSeconds(-30).AddSeconds(60) < DateTime.UtcNow; - Assert.IsFalse(condition); - } - internal static IEnumerable OldCreatingDatesTestCases() { yield return new object[] { DateTime.UtcNow.AddMinutes(-2), DateTime.UtcNow }; @@ -53,7 +46,6 @@ internal static IEnumerable NewCreatingDatesTestCases() { yield return new object[] { true, DateTime.UtcNow.AddSeconds(-30), DateTime.UtcNow }; yield return new object[] { true, DateTime.UtcNow.AddSeconds(30), DateTime.UtcNow }; - yield return new object[] { true, DateTime.UtcNow.AddSeconds(1000), DateTime.UtcNow }; yield return new object[] { true, DateTime.UtcNow, DateTime.UtcNow }; yield return new object[] { false, null, DateTime.UtcNow }; } diff --git a/Snowflake.Data/Core/Tools/DirectoryInformation.cs b/Snowflake.Data/Core/Tools/DirectoryInformation.cs index 84a242ed5..82fc6e64b 100644 --- a/Snowflake.Data/Core/Tools/DirectoryInformation.cs +++ b/Snowflake.Data/Core/Tools/DirectoryInformation.cs @@ -1,13 +1,10 @@ using System; using System.IO; -using Snowflake.Data.Log; namespace Snowflake.Data.Core.Tools { public class DirectoryInformation { - private static readonly SFLogger s_logger = SFLoggerFactory.GetLogger(); - private readonly bool _exists; private readonly DateTime? _creationTimeUtc; @@ -24,14 +21,8 @@ internal DirectoryInformation(bool exists, DateTime? creationTimeUtc) _creationTimeUtc = creationTimeUtc; } - public bool IsCreatedEarlierThanSeconds(int seconds, DateTime utcNow) - { - s_logger.Warn($"Now is {utcNow}"); - s_logger.Warn($"CreationTimeUtc is {_creationTimeUtc}"); - s_logger.Warn($"CreationTimeUtc + {60} seconds is {_creationTimeUtc?.AddSeconds(seconds)}"); - s_logger.Warn($"Result of date comparison is {_creationTimeUtc?.AddSeconds(seconds) < utcNow}"); - return _exists && _creationTimeUtc?.AddSeconds(seconds) < utcNow; - } + public bool IsCreatedEarlierThanSeconds(int seconds, DateTime utcNow) => + _exists && _creationTimeUtc?.AddSeconds(seconds) < utcNow; public bool Exists() => _exists; }