Beispiel #1
0
        public void CollectionResetDocumentsTest()
        {
            CollectionResetTestWindow window = TestWindow.Value;

            Assert.IsTrue(window.IsLoaded);

            var adapter = new DocumentsTestAdapter(window);

            TestResetNotification(adapter);
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
 public DocumentsTestAdapter(CollectionResetTestWindow window)
 {
     _window = window;
 }
Beispiel #4
0
 public AnchorablesTestAdapter(CollectionResetTestWindow window)
 {
     _window = window;
 }