@@ -6153,15 +6153,15 @@ public void Sftp_SetLastAccessTime()
61536153 try
61546154 {
61556155 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 ) ;
61596156
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 ) ;
61616160
61626161 client . SetLastAccessTime ( testFilePath , newTime ) ;
61636162 time = client . GetLastAccessTime ( testFilePath ) ;
6164- Assert . AreEqual ( newTime , time ) ;
6163+
6164+ DateTimeAssert . AreEqual ( newTime . TruncateToWholeSeconds ( ) , time ) ;
61656165 }
61666166 finally
61676167 {
@@ -6185,16 +6185,15 @@ public void Sftp_SetLastAccessTimeUtc()
61856185 try
61866186 {
61876187 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 ) ;
61916188
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 ) ;
61946192
61956193 client . SetLastAccessTimeUtc ( testFilePath , newTime ) ;
61966194 time = client . GetLastAccessTimeUtc ( testFilePath ) ;
6197- Assert . AreEqual ( newTime , time ) ;
6195+
6196+ DateTimeAssert . AreEqual ( newTime . TruncateToWholeSeconds ( ) , time ) ;
61986197 }
61996198 finally
62006199 {
@@ -6217,15 +6216,15 @@ public void Sftp_SetLastWriteTime()
62176216 try
62186217 {
62196218 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 ) ;
62236219
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 ) ;
62256223
62266224 client . SetLastWriteTime ( testFilePath , newTime ) ;
62276225 time = client . GetLastWriteTime ( testFilePath ) ;
6228- Assert . AreEqual ( newTime , time ) ;
6226+
6227+ DateTimeAssert . AreEqual ( newTime . TruncateToWholeSeconds ( ) , time ) ;
62296228 }
62306229 finally
62316230 {
@@ -6248,16 +6247,15 @@ public void Sftp_SetLastWriteTimeUtc()
62486247 try
62496248 {
62506249 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 ) ;
62546250
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 ) ;
62576254
62586255 client . SetLastWriteTimeUtc ( testFilePath , newTime ) ;
62596256 time = client . GetLastWriteTimeUtc ( testFilePath ) ;
6260- Assert . AreEqual ( newTime , time ) ;
6257+
6258+ DateTimeAssert . AreEqual ( newTime . TruncateToWholeSeconds ( ) , time ) ;
62616259 }
62626260 finally
62636261 {
0 commit comments