|
@@ -6153,15 +6153,15 @@ namespace Renci.SshNet.IntegrationTests
|
|
|
try
|
|
try
|
|
|
{
|
|
{
|
|
|
var time = client.GetLastAccessTime(testFilePath);
|
|
var time = client.GetLastAccessTime(testFilePath);
|
|
|
- Assert.AreEqual(currentTime.Year, time.Year);
|
|
|
|
|
- Assert.AreEqual(currentTime.Month, time.Month);
|
|
|
|
|
- Assert.AreEqual(currentTime.Day, time.Day);
|
|
|
|
|
|
|
|
|
|
- var newTime = new DateTime(1986, 03, 15, 01, 02, 03);
|
|
|
|
|
|
|
+ DateTimeAssert.AreEqual(currentTime.TruncateToWholeSeconds(), time);
|
|
|
|
|
+
|
|
|
|
|
+ var newTime = new DateTime(1986, 03, 15, 01, 02, 03, 123, DateTimeKind.Local);
|
|
|
|
|
|
|
|
client.SetLastAccessTime(testFilePath, newTime);
|
|
client.SetLastAccessTime(testFilePath, newTime);
|
|
|
time = client.GetLastAccessTime(testFilePath);
|
|
time = client.GetLastAccessTime(testFilePath);
|
|
|
- Assert.AreEqual(newTime, time);
|
|
|
|
|
|
|
+
|
|
|
|
|
+ DateTimeAssert.AreEqual(newTime.TruncateToWholeSeconds(), time);
|
|
|
}
|
|
}
|
|
|
finally
|
|
finally
|
|
|
{
|
|
{
|
|
@@ -6185,16 +6185,15 @@ namespace Renci.SshNet.IntegrationTests
|
|
|
try
|
|
try
|
|
|
{
|
|
{
|
|
|
var time = client.GetLastAccessTimeUtc(testFilePath);
|
|
var time = client.GetLastAccessTimeUtc(testFilePath);
|
|
|
- Assert.AreEqual(currentTime.Year, time.Year);
|
|
|
|
|
- Assert.AreEqual(currentTime.Month, time.Month);
|
|
|
|
|
- Assert.AreEqual(currentTime.Day, time.Day);
|
|
|
|
|
|
|
|
|
|
- var newTime = new DateTime(1986, 03, 15, 01, 02, 03);
|
|
|
|
|
- DateTime.SpecifyKind(newTime, DateTimeKind.Utc);
|
|
|
|
|
|
|
+ DateTimeAssert.AreEqual(currentTime.TruncateToWholeSeconds(), time);
|
|
|
|
|
+
|
|
|
|
|
+ var newTime = new DateTime(1986, 03, 15, 01, 02, 03, 123, DateTimeKind.Utc);
|
|
|
|
|
|
|
|
client.SetLastAccessTimeUtc(testFilePath, newTime);
|
|
client.SetLastAccessTimeUtc(testFilePath, newTime);
|
|
|
time = client.GetLastAccessTimeUtc(testFilePath);
|
|
time = client.GetLastAccessTimeUtc(testFilePath);
|
|
|
- Assert.AreEqual(newTime, time);
|
|
|
|
|
|
|
+
|
|
|
|
|
+ DateTimeAssert.AreEqual(newTime.TruncateToWholeSeconds(), time);
|
|
|
}
|
|
}
|
|
|
finally
|
|
finally
|
|
|
{
|
|
{
|
|
@@ -6217,15 +6216,15 @@ namespace Renci.SshNet.IntegrationTests
|
|
|
try
|
|
try
|
|
|
{
|
|
{
|
|
|
var time = client.GetLastWriteTime(testFilePath);
|
|
var time = client.GetLastWriteTime(testFilePath);
|
|
|
- Assert.AreEqual(currentTime.Year, time.Year);
|
|
|
|
|
- Assert.AreEqual(currentTime.Month, time.Month);
|
|
|
|
|
- Assert.AreEqual(currentTime.Day, time.Day);
|
|
|
|
|
|
|
|
|
|
- var newTime = new DateTime(1986, 03, 15, 01, 02, 03);
|
|
|
|
|
|
|
+ DateTimeAssert.AreEqual(currentTime.TruncateToWholeSeconds(), time);
|
|
|
|
|
+
|
|
|
|
|
+ var newTime = new DateTime(1986, 03, 15, 01, 02, 03, 123, DateTimeKind.Local);
|
|
|
|
|
|
|
|
client.SetLastWriteTime(testFilePath, newTime);
|
|
client.SetLastWriteTime(testFilePath, newTime);
|
|
|
time = client.GetLastWriteTime(testFilePath);
|
|
time = client.GetLastWriteTime(testFilePath);
|
|
|
- Assert.AreEqual(newTime, time);
|
|
|
|
|
|
|
+
|
|
|
|
|
+ DateTimeAssert.AreEqual(newTime.TruncateToWholeSeconds(), time);
|
|
|
}
|
|
}
|
|
|
finally
|
|
finally
|
|
|
{
|
|
{
|
|
@@ -6248,16 +6247,15 @@ namespace Renci.SshNet.IntegrationTests
|
|
|
try
|
|
try
|
|
|
{
|
|
{
|
|
|
var time = client.GetLastWriteTimeUtc(testFilePath);
|
|
var time = client.GetLastWriteTimeUtc(testFilePath);
|
|
|
- Assert.AreEqual(currentTime.Year, time.Year);
|
|
|
|
|
- Assert.AreEqual(currentTime.Month, time.Month);
|
|
|
|
|
- Assert.AreEqual(currentTime.Day, time.Day);
|
|
|
|
|
|
|
|
|
|
- var newTime = new DateTime(1986, 03, 15, 01, 02, 03);
|
|
|
|
|
- DateTime.SpecifyKind(newTime, DateTimeKind.Utc);
|
|
|
|
|
|
|
+ DateTimeAssert.AreEqual(currentTime.TruncateToWholeSeconds(), time);
|
|
|
|
|
+
|
|
|
|
|
+ var newTime = new DateTime(1986, 03, 15, 01, 02, 03, 123, DateTimeKind.Utc);
|
|
|
|
|
|
|
|
client.SetLastWriteTimeUtc(testFilePath, newTime);
|
|
client.SetLastWriteTimeUtc(testFilePath, newTime);
|
|
|
time = client.GetLastWriteTimeUtc(testFilePath);
|
|
time = client.GetLastWriteTimeUtc(testFilePath);
|
|
|
- Assert.AreEqual(newTime, time);
|
|
|
|
|
|
|
+
|
|
|
|
|
+ DateTimeAssert.AreEqual(newTime.TruncateToWholeSeconds(), time);
|
|
|
}
|
|
}
|
|
|
finally
|
|
finally
|
|
|
{
|
|
{
|