예제 #1
0
        protected override async Task <DocumentView> OnInitializeView()
        {
            InnerController = new LoadTestController();
            await InnerController.Initialize(null);

            return(await InnerController.GetDocumentView());
        }
예제 #2
0
        public async Task LoadAndReload(LoadTestController controller)
        {
            await controller.Initialize(new ModelDescriptor());

            var doc = await documentManager.OpenDocument(controller);

            Assert.AreEqual(0, controller.Loaded);
            Assert.AreEqual(0, controller.Reloaded);

            if (controller.InnerController != null)
            {
                Assert.AreEqual(0, controller.InnerController.Loaded);
                Assert.AreEqual(0, controller.InnerController.Reloaded);
            }

            await controller.GetDocumentView();

            Assert.AreEqual(0, controller.Loaded);
            Assert.AreEqual(0, controller.Reloaded);

            if (controller.InnerController != null)
            {
                Assert.AreEqual(0, controller.InnerController.Loaded);
                Assert.AreEqual(0, controller.InnerController.Reloaded);
            }

            await doc.ForceShow();

            Assert.AreEqual(1, controller.Loaded);
            Assert.AreEqual(0, controller.Reloaded);

            if (controller.InnerController != null)
            {
                Assert.AreEqual(1, controller.InnerController.Loaded);
                Assert.AreEqual(0, controller.InnerController.Reloaded);
            }

            await doc.Reload();

            Assert.AreEqual(1, controller.Loaded);
            Assert.AreEqual(1, controller.Reloaded);

            if (controller.InnerController != null)
            {
                Assert.AreEqual(1, controller.InnerController.Loaded);
                Assert.AreEqual(0, controller.InnerController.Reloaded);
            }

            await doc.Reload();

            Assert.AreEqual(1, controller.Loaded);
            Assert.AreEqual(2, controller.Reloaded);

            if (controller.InnerController != null)
            {
                Assert.AreEqual(1, controller.InnerController.Loaded);
                Assert.AreEqual(0, controller.InnerController.Reloaded);
            }
        }
예제 #3
0
        protected override async Task <DocumentView> OnInitializeView()
        {
            var container = new DocumentViewContainer();

            InnerController = new LoadTestController();
            await InnerController.Initialize(null);

            container.Views.Add(await InnerController.GetDocumentView());
            return(container);
        }