diff options
author | Dean Ferreyra <dean@octw.com> | 2020-09-12 09:25:03 +0300 |
---|---|---|
committer | Dean Ferreyra <dean@octw.com> | 2020-09-12 09:25:03 +0300 |
commit | 2c56634899182705fec7d27580b857e01b03f315 (patch) | |
tree | ac79175a3068e42d791963575cb72f2b8778eeac /Duplicati/UnitTest/TestUtils.cs | |
parent | f4195e4eb09503850b72b9cc4f71093255bc4483 (diff) |
Add tolerance to file time comparisons
Diffstat (limited to 'Duplicati/UnitTest/TestUtils.cs')
-rw-r--r-- | Duplicati/UnitTest/TestUtils.cs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Duplicati/UnitTest/TestUtils.cs b/Duplicati/UnitTest/TestUtils.cs index 6bdb0a57b..8eca8483f 100644 --- a/Duplicati/UnitTest/TestUtils.cs +++ b/Duplicati/UnitTest/TestUtils.cs @@ -237,8 +237,14 @@ namespace Duplicati.UnitTest // Compare file metadata
if (verifymetadata)
{
- Assert.That(SystemIO.IO_OS.GetLastWriteTimeUtc(actualFile), Is.EqualTo(SystemIO.IO_OS.GetLastWriteTimeUtc(expectedFile)), $"{contextMessage}, last write time mismatch for {expectedFile} and {actualFile}");
- Assert.That(SystemIO.IO_OS.GetCreationTimeUtc(actualFile), Is.EqualTo(SystemIO.IO_OS.GetCreationTimeUtc(expectedFile)), $"{contextMessage}, creation time mismatch for {expectedFile} and {actualFile}");
+ Assert.That(
+ SystemIO.IO_OS.GetLastWriteTimeUtc(actualFile),
+ Is.EqualTo(SystemIO.IO_OS.GetLastWriteTimeUtc(expectedFile)).Within(1).Milliseconds,
+ $"{contextMessage}, last write time mismatch for {expectedFile} and {actualFile}");
+ Assert.That(
+ SystemIO.IO_OS.GetCreationTimeUtc(actualFile),
+ Is.EqualTo(SystemIO.IO_OS.GetCreationTimeUtc(expectedFile)).Within(1).Milliseconds,
+ $"{contextMessage}, creation time mismatch for {expectedFile} and {actualFile}");
}
}
|