diff --git a/test/Renci.SshNet.IntegrationTests/SftpTests.cs b/test/Renci.SshNet.IntegrationTests/SftpTests.cs index 5b8373f60..b89079e7b 100644 --- a/test/Renci.SshNet.IntegrationTests/SftpTests.cs +++ b/test/Renci.SshNet.IntegrationTests/SftpTests.cs @@ -6142,20 +6142,15 @@ public void Sftp_SetLastAccessTime() client.Connect(); using var fileStream = new MemoryStream(Encoding.UTF8.GetBytes(testContent)); - var currentTime = DateTime.Now; client.UploadFile(fileStream, testFilePath); try { - var time = client.GetLastAccessTime(testFilePath); - - DateTimeAssert.AreEqual(currentTime.TruncateToWholeSeconds(), time); - var newTime = new DateTime(1986, 03, 15, 01, 02, 03, 123, DateTimeKind.Local); client.SetLastAccessTime(testFilePath, newTime); - time = client.GetLastAccessTime(testFilePath); + var time = client.GetLastAccessTime(testFilePath); DateTimeAssert.AreEqual(newTime.TruncateToWholeSeconds(), time); } @@ -6175,19 +6170,14 @@ public void Sftp_SetLastAccessTimeUtc() client.Connect(); using var fileStream = new MemoryStream(Encoding.UTF8.GetBytes(testContent)); - var currentTime = DateTime.UtcNow; client.UploadFile(fileStream, testFilePath); try { - var time = client.GetLastAccessTimeUtc(testFilePath); - - DateTimeAssert.AreEqual(currentTime.TruncateToWholeSeconds(), time); - var newTime = new DateTime(1986, 03, 15, 01, 02, 03, 123, DateTimeKind.Utc); client.SetLastAccessTimeUtc(testFilePath, newTime); - time = client.GetLastAccessTimeUtc(testFilePath); + var time = client.GetLastAccessTimeUtc(testFilePath); DateTimeAssert.AreEqual(newTime.TruncateToWholeSeconds(), time); } @@ -6206,19 +6196,14 @@ public void Sftp_SetLastWriteTime() client.Connect(); using var fileStream = new MemoryStream(Encoding.UTF8.GetBytes(testContent)); - var currentTime = DateTime.Now; client.UploadFile(fileStream, testFilePath); try { - var time = client.GetLastWriteTime(testFilePath); - - DateTimeAssert.AreEqual(currentTime.TruncateToWholeSeconds(), time); - var newTime = new DateTime(1986, 03, 15, 01, 02, 03, 123, DateTimeKind.Local); client.SetLastWriteTime(testFilePath, newTime); - time = client.GetLastWriteTime(testFilePath); + var time = client.GetLastWriteTime(testFilePath); DateTimeAssert.AreEqual(newTime.TruncateToWholeSeconds(), time); }