@@ -41,6 +41,57 @@ public async Task StatAsyncTest()
4141 Assert . Equal ( $ "-rw-r-----\t 597\t { value . Time } \t /fstab.donatello", value . ToString ( ) ) ;
4242 }
4343
44+ /// <summary>
45+ /// Tests the <see cref="SyncService.StatExAsync(string, CancellationToken)"/> method.
46+ /// </summary>
47+ [ Fact ]
48+ public async Task StatExAsyncTest ( )
49+ {
50+ FileStatisticsEx value = await RunTestAsync (
51+ OkResponses ( 2 ) ,
52+ NoResponseMessages ,
53+ [ "host:transport:169.254.109.177:5555" , "sync:" ] ,
54+ [ ( SyncCommand . STA2 , "/fstab.donatello" ) ] ,
55+ [ SyncCommand . STA2 ] ,
56+ [ [
57+ 0 , 0 , 0 , 0 ,
58+ 167 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
59+ 38 , 240 , 15 , 0 , 0 , 0 , 0 , 0 ,
60+ 160 , 129 , 0 , 0 ,
61+ 1 , 0 , 0 , 0 ,
62+ 146 , 39 , 0 , 0 ,
63+ 255 , 3 , 0 , 0 ,
64+ 85 , 2 , 0 , 0 , 0 , 0 , 0 , 0 ,
65+ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
66+ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
67+ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0
68+ ] ] ,
69+ null ,
70+ async ( ) =>
71+ {
72+ using SyncService service = new ( Socket , Device ) ;
73+ FileStatisticsEx value = await service . StatExAsync ( "/fstab.donatello" ) ;
74+ Assert . False ( service . IsProcessing ) ;
75+ Assert . False ( service . IsOutdate ) ;
76+ return value ;
77+ } ) ;
78+
79+ Assert . Equal ( "/fstab.donatello" , value . Path ) ;
80+ Assert . Equal ( UnixErrorCode . Default , value . Error ) ;
81+ Assert . Equal ( 167u , value . Device ) ;
82+ Assert . Equal ( 1044518u , value . IndexNode ) ;
83+ Assert . Equal ( UnixFileStatus . Regular , value . FileMode . GetFileType ( ) ) ;
84+ Assert . Equal ( ( UnixFileStatus ) 416 , value . FileMode . GetPermissions ( ) ) ;
85+ Assert . Equal ( 1u , value . LinkCount ) ;
86+ Assert . Equal ( 597u , value . Size ) ;
87+ Assert . Equal ( 10130u , value . UserId ) ;
88+ Assert . Equal ( 1023u , value . GroupId ) ;
89+ Assert . Equal ( DateTimeExtensions . Epoch . ToLocalTime ( ) , value . AccessTime ) ;
90+ Assert . Equal ( DateTimeExtensions . Epoch . ToLocalTime ( ) , value . ModifiedTime ) ;
91+ Assert . Equal ( DateTimeExtensions . Epoch . ToLocalTime ( ) , value . ChangedTime ) ;
92+ Assert . Equal ( $ "-rw-r-----\t 597\t { value . ModifiedTime } \t /fstab.donatello", value . ToString ( ) ) ;
93+ }
94+
4495 /// <summary>
4596 /// Tests the <see cref="SyncService.GetDirectoryListingAsync(string, CancellationToken)"/> method.
4697 /// </summary>
@@ -201,7 +252,7 @@ await RunTestAsync(
201252 }
202253
203254 /// <summary>
204- /// Tests the <see cref="SyncService.PushAsync(Stream, string, UnixFileStatus, DateTimeOffset, Action{SyncProgressChangedEventArgs}?, CancellationToken)"/> method.
255+ /// Tests the <see cref="SyncService.PushAsync(Stream, string, UnixFileStatus, DateTimeOffset, Action{SyncProgressChangedEventArgs}?, bool, CancellationToken)"/> method.
205256 /// </summary>
206257 [ Fact ]
207258 public async Task PushAsyncTest ( )
0 commit comments