@@ -6153,15 +6153,15 @@ public void Sftp_SetLastAccessTime()
6153
6153
try
6154
6154
{
6155
6155
var time = client . GetLastAccessTime ( testFilePath ) ;
6156
- Assert . AreEqual ( currentTime . Year , time . Year ) ;
6157
- Assert . AreEqual ( currentTime . Month , time . Month ) ;
6158
- Assert . AreEqual ( currentTime . Day , time . Day ) ;
6159
6156
6160
- var newTime = new DateTime ( 1986 , 03 , 15 , 01 , 02 , 03 ) ;
6157
+ DateTimeAssert . AreEqual ( currentTime . TruncateToWholeSeconds ( ) , time ) ;
6158
+
6159
+ var newTime = new DateTime ( 1986 , 03 , 15 , 01 , 02 , 03 , 123 , DateTimeKind . Local ) ;
6161
6160
6162
6161
client . SetLastAccessTime ( testFilePath , newTime ) ;
6163
6162
time = client . GetLastAccessTime ( testFilePath ) ;
6164
- Assert . AreEqual ( newTime , time ) ;
6163
+
6164
+ DateTimeAssert . AreEqual ( newTime . TruncateToWholeSeconds ( ) , time ) ;
6165
6165
}
6166
6166
finally
6167
6167
{
@@ -6185,16 +6185,15 @@ public void Sftp_SetLastAccessTimeUtc()
6185
6185
try
6186
6186
{
6187
6187
var time = client . GetLastAccessTimeUtc ( testFilePath ) ;
6188
- Assert . AreEqual ( currentTime . Year , time . Year ) ;
6189
- Assert . AreEqual ( currentTime . Month , time . Month ) ;
6190
- Assert . AreEqual ( currentTime . Day , time . Day ) ;
6191
6188
6192
- var newTime = new DateTime ( 1986 , 03 , 15 , 01 , 02 , 03 ) ;
6193
- DateTime . SpecifyKind ( newTime , DateTimeKind . Utc ) ;
6189
+ DateTimeAssert . AreEqual ( currentTime . TruncateToWholeSeconds ( ) , time ) ;
6190
+
6191
+ var newTime = new DateTime ( 1986 , 03 , 15 , 01 , 02 , 03 , 123 , DateTimeKind . Utc ) ;
6194
6192
6195
6193
client . SetLastAccessTimeUtc ( testFilePath , newTime ) ;
6196
6194
time = client . GetLastAccessTimeUtc ( testFilePath ) ;
6197
- Assert . AreEqual ( newTime , time ) ;
6195
+
6196
+ DateTimeAssert . AreEqual ( newTime . TruncateToWholeSeconds ( ) , time ) ;
6198
6197
}
6199
6198
finally
6200
6199
{
@@ -6217,15 +6216,15 @@ public void Sftp_SetLastWriteTime()
6217
6216
try
6218
6217
{
6219
6218
var time = client . GetLastWriteTime ( testFilePath ) ;
6220
- Assert . AreEqual ( currentTime . Year , time . Year ) ;
6221
- Assert . AreEqual ( currentTime . Month , time . Month ) ;
6222
- Assert . AreEqual ( currentTime . Day , time . Day ) ;
6223
6219
6224
- var newTime = new DateTime ( 1986 , 03 , 15 , 01 , 02 , 03 ) ;
6220
+ DateTimeAssert . AreEqual ( currentTime . TruncateToWholeSeconds ( ) , time ) ;
6221
+
6222
+ var newTime = new DateTime ( 1986 , 03 , 15 , 01 , 02 , 03 , 123 , DateTimeKind . Local ) ;
6225
6223
6226
6224
client . SetLastWriteTime ( testFilePath , newTime ) ;
6227
6225
time = client . GetLastWriteTime ( testFilePath ) ;
6228
- Assert . AreEqual ( newTime , time ) ;
6226
+
6227
+ DateTimeAssert . AreEqual ( newTime . TruncateToWholeSeconds ( ) , time ) ;
6229
6228
}
6230
6229
finally
6231
6230
{
@@ -6248,16 +6247,15 @@ public void Sftp_SetLastWriteTimeUtc()
6248
6247
try
6249
6248
{
6250
6249
var time = client . GetLastWriteTimeUtc ( testFilePath ) ;
6251
- Assert . AreEqual ( currentTime . Year , time . Year ) ;
6252
- Assert . AreEqual ( currentTime . Month , time . Month ) ;
6253
- Assert . AreEqual ( currentTime . Day , time . Day ) ;
6254
6250
6255
- var newTime = new DateTime ( 1986 , 03 , 15 , 01 , 02 , 03 ) ;
6256
- DateTime . SpecifyKind ( newTime , DateTimeKind . Utc ) ;
6251
+ DateTimeAssert . AreEqual ( currentTime . TruncateToWholeSeconds ( ) , time ) ;
6252
+
6253
+ var newTime = new DateTime ( 1986 , 03 , 15 , 01 , 02 , 03 , 123 , DateTimeKind . Utc ) ;
6257
6254
6258
6255
client . SetLastWriteTimeUtc ( testFilePath , newTime ) ;
6259
6256
time = client . GetLastWriteTimeUtc ( testFilePath ) ;
6260
- Assert . AreEqual ( newTime , time ) ;
6257
+
6258
+ DateTimeAssert . AreEqual ( newTime . TruncateToWholeSeconds ( ) , time ) ;
6261
6259
}
6262
6260
finally
6263
6261
{
0 commit comments