public void CollectionResetDocumentsTest() { CollectionResetTestWindow window = TestWindow.Value; Assert.IsTrue(window.IsLoaded); var adapter = new DocumentsTestAdapter(window); TestResetNotification(adapter); }
private static CollectionResetTestWindow CreateTestWindow() { TestHost.SwitchToAppThread(); var task = WindowHelpers.CreateInvisibleWindowAsync <CollectionResetTestWindow>(); task.Wait(); CollectionResetTestWindow window = task.Result; Assert.IsTrue(window.IsLoaded); // Hook up to ObservableCollection notifications window.Anchorables.CollectionChanged += (s, e) => { UpdateNotificationCount(e, AnchorNotifications); }; window.Documents.CollectionChanged += (s, e) => { UpdateNotificationCount(e, DocumentNotifications); }; // Create some anchorable test items for (int index = 0; index < ExpectedAnchorableCount; index++) { var child = new UserControl() { Tag = $"Anchorable {index}" }; window.Anchorables.Add(child); } // Create some document test items for (int index = 0; index < ExpectedDocumentCount; index++) { var child = new UserControl() { Tag = $"Document {index}" }; window.Documents.Add(child); } return(window); }
public DocumentsTestAdapter(CollectionResetTestWindow window) { _window = window; }
public AnchorablesTestAdapter(CollectionResetTestWindow window) { _window = window; }