Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit 397099b

Browse files
committed
Added failing test for #1436
1 parent 9eb8dfb commit 397099b

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

test/UnitTests/GitHub.App/ViewModels/GitHubPane/NavigationViewModelTests.cs

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
24
using System.Reactive;
35
using System.Reactive.Linq;
46
using 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

0 commit comments

Comments
 (0)