11extern alias viewer ;
22
3- using System . Collections . Concurrent ;
4-
53// The viewer's own copies of the protocol types. DiffEngineViewer links DiffEngine's Inline and
64// Protocol sources rather than referencing them, so the same names exist in both assemblies and
75// only the alias tells them apart. That duplication is the point of these tests: the two halves
@@ -130,7 +128,7 @@ public async Task TrayAcceptOfATrackedMoveReachesTheAttachedViewer()
130128 pair . Tracker . Accept ( pair . Tracker . Moves . Single ( ) ) ;
131129
132130 await Assert . That ( pair . Pump ( ) . Keys ( ) ) . IsEquivalentTo ( [ Key ( sample , 1 ) ] ) ;
133- await Assert . That ( File . ReadAllText ( move . Target ) ) . IsEqualTo ( "received" ) ;
131+ await Assert . That ( await File . ReadAllTextAsync ( move . Target ) ) . IsEqualTo ( "received" ) ;
134132 }
135133
136134 [ Test ]
@@ -186,7 +184,7 @@ public async Task ViewerAcceptAllEmptiesTheTray()
186184 await Assert . That ( pair . Tracker . Snapshots ) . IsEmpty ( ) ;
187185 await Assert . That ( pair . Tracker . Moves ) . IsEmpty ( ) ;
188186 await Assert . That ( pair . Tracker . Deletes ) . IsEmpty ( ) ;
189- await Assert . That ( File . ReadAllText ( move . Target ) ) . IsEqualTo ( "received" ) ;
187+ await Assert . That ( await File . ReadAllTextAsync ( move . Target ) ) . IsEqualTo ( "received" ) ;
190188 await Assert . That ( File . Exists ( delete . File ) ) . IsFalse ( ) ;
191189 }
192190
@@ -250,7 +248,7 @@ public async Task ViewerAcceptOfATrackedMoveReachesTheTray()
250248
251249 await Assert . That ( pair . Pump ( ) . Keys ( ) ) . IsEquivalentTo ( [ Key ( sample , 1 ) ] ) ;
252250 await Assert . That ( pair . Tracker . Moves ) . IsEmpty ( ) ;
253- await Assert . That ( File . ReadAllText ( move . Target ) ) . IsEqualTo ( "received" ) ;
251+ await Assert . That ( await File . ReadAllTextAsync ( move . Target ) ) . IsEqualTo ( "received" ) ;
254252 }
255253
256254 /// <summary>
@@ -493,7 +491,7 @@ public async Task ADeleteWithNoTrayReachesTheViewerAndTheFileGoes()
493491 using var noTray = new NoTray ( ) ;
494492 var file = pair . StageStaleFile ( ) ;
495493
496- DiffRunner . AddDelete ( file ) ;
494+ await DiffRunner . AddDeleteAsync ( file ) ;
497495
498496 await Assert . That ( pair . Viewer . Keys ( ) ) . IsEquivalentTo ( [ TrackedKeys . ForDelete ( file ) ] ) ;
499497
@@ -535,7 +533,7 @@ public async Task AMoveWithNoTrayReachesTheViewerAndTheFileMoves()
535533
536534 pair . Act ( CommandKind . Accept , move . Key ) ;
537535
538- await Assert . That ( File . ReadAllText ( move . Target ) ) . IsEqualTo ( "received" ) ;
536+ await Assert . That ( await File . ReadAllTextAsync ( move . Target ) ) . IsEqualTo ( "received" ) ;
539537 await Assert . That ( File . Exists ( move . Temp ) ) . IsFalse ( ) ;
540538 }
541539
@@ -564,7 +562,7 @@ public async Task AResentMoveReplacesItsEntry()
564562 var move = pair . StageMove ( ) ;
565563 PendingFiles . AddMove ( move . Temp , move . Target , null , null , false , null ) ;
566564
567- File . WriteAllText ( move . Temp , "second run" ) ;
565+ await File . WriteAllTextAsync ( move . Temp , "second run" ) ;
568566 PendingFiles . AddMove ( move . Temp , move . Target , null , null , false , null ) ;
569567
570568 await Assert . That ( pair . Viewer . Queue ) . HasSingleItem ( ) ;
@@ -581,7 +579,7 @@ public async Task AFullListingCarriesTheViewersOwnPendingFiles()
581579 await using var pair = new ViewerOwned ( ) ;
582580 using var noTray = new NoTray ( ) ;
583581 var file = pair . StageStaleFile ( ) ;
584- DiffRunner . AddDelete ( file ) ;
582+ await DiffRunner . AddDeleteAsync ( file ) ;
585583
586584 var full = pair . Send ( new ( ViewerVerb . ListFull ) ) ;
587585 var plain = pair . Send ( new ( ViewerVerb . List ) ) ;
@@ -801,7 +799,7 @@ public ViewerOwned(Func<ViewerSidePatch, ViewerSideApplyResult>? applier = null)
801799 previousPort = Environment . GetEnvironmentVariable ( ViewerClient . PortVariable ) ;
802800 Environment . SetEnvironmentVariable ( ViewerClient . PortVariable , server . Port . ToString ( ) ) ;
803801 Window = new ( SessionState . Start ( ViewerMode . Inline ) ) ;
804- actions = new ViewerActions (
802+ actions = new (
805803 patch =>
806804 {
807805 Applied . Add ( patch ) ;
0 commit comments