public void ViewStateWatcher_Hears_When_View_Is_Removed()
        {
            bool heardEvent = false;

            context.Configure(new ContextView(contextViewObject));
            IViewStateWatcher actual = context.injector.GetInstance <IViewStateWatcher>() as IViewStateWatcher;

            actual.removed += delegate(object obj) {
                heardEvent = true;
            };
            contextViewObject.RemoveThisView();

            Assert.That(heardEvent, Is.True);
        }
        public async void Automatically_Unprocesses_When_View_Leaves_Stage()
        {
            viewProcessorMap.Map(matchingView.GetType()).ToProcess(trackingProcessor);
            matchingView.AddThisView();
            viewProcessorMap.Process(matchingView);

            matchingView.RemoveView += CheckUnprocessorsRan;
            matchingView.RemoveThisView();
            await Task.Delay(500);
        }
 public void Removing_ContextView_From_Stage_Destroys_Context()
 {
     context
     .Install(typeof(TestSupportViewStateWatcherExtension))
     .Install(typeof(StageSyncExtension))
     .Configure(new ContextView(contextView));
     contextView.AddThisView();
     contextView.RemoveThisView();
     Assert.That(context.Destroyed, Is.True);
 }
        public async void Automatically_Unprocesses_When_View_Leaves_Stage()
        {
            instance.Map(typeof(SupportView)).ToProcess(new MediatorCreator(typeof(SupportMediator)));
            matchingView.AddThisView();
            instance.Process(matchingView);
            Action <IView> removeViewCallback = null;

            removeViewCallback = delegate(IView view) {
                matchingView.RemoveView -= removeViewCallback;
                CheckMediatorsDestroyed(view);
            };
            matchingView.RemoveView += removeViewCallback;
            matchingView.RemoveThisView();
            await Task.Delay(500);
        }
Пример #5
0
 public void TearDown()
 {
     container.RemoveThisView();
 }
        /*============================================================================*/
        /* Private Functions                                                          */
        /*============================================================================*/

        private void AddRootToStage()
        {
            root.RemoveThisView();
        }