This repository was archived by the owner on Jun 21, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed
test/UnitTests/GitHub.App/ViewModels/GitHubPane Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change 11using System ;
2+ using System . Collections . Generic ;
3+ using System . Linq ;
24using System . Reactive ;
35using System . Reactive . Linq ;
46using System . Reactive . Subjects ;
@@ -309,6 +311,36 @@ public void CallsDeactivatedAndThenDisposedOnPages()
309311 first . Dispose ( ) ;
310312 } ) ;
311313 }
314+
315+ [ Test ]
316+ public void DoesntThrowWhenHistoryHasMoreThan10Items ( )
317+ {
318+ var target = new NavigationViewModel ( ) ;
319+ var pages = new List < IPanePageViewModel > ( ) ;
320+
321+ for ( var i = 0 ; i < 11 ; ++ i )
322+ {
323+ var page = CreatePage ( ) ;
324+ pages . Add ( page ) ;
325+ target . NavigateTo ( page ) ;
326+ }
327+
328+ foreach ( var page in pages )
329+ {
330+ page . ClearReceivedCalls ( ) ;
331+ }
332+
333+ target . Clear ( ) ;
334+
335+ pages . Last ( ) . Received ( ) . Deactivated ( ) ;
336+ pages . Last ( ) . Received ( ) . Dispose ( ) ;
337+
338+ foreach ( var page in pages . Take ( pages . Count - 1 ) )
339+ {
340+ page . DidNotReceive ( ) . Deactivated ( ) ;
341+ page . Received ( ) . Dispose ( ) ;
342+ }
343+ }
312344 }
313345
314346 public class TheRemoveMethod
You can’t perform that action at this time.
0 commit comments